code_junkie

How do I include a newline character in a string in Delphi?

Nov 12th, 2011
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. const
  2. sLineBreak = {$IFDEF LINUX} AnsiChar(#10) {$ENDIF}
  3. {$IFDEF MSWINDOWS} AnsiString(#13#10) {$ENDIF};
  4.  
  5. label1.Caption := 'Line one'+sLineBreak+'Line two';
  6.  
  7. Label1.Caption := Memo1.Lines.Text;
  8.  
  9. MyString := 'Hello,' + ^M + ^J + 'world!';
Add Comment
Please, Sign In to add comment