Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
type TSysCharSet = set of Char;
function WrapText(const StrLine, BreakStr: string; BreakChars: TSysCharSet; MaxCol: integer): string; overload;
function WrapText(const StrLine: string; MaxCol: integer = 45): string; overload;
Returns a string broken into multiple lines.
Each line of text in StrLine is broken when a line reaches MaxCol characters.
BreakStr is inserted in the string after a series of BreakChar characters at the end of the line, to create a line break.
If the BreakStr and BreakChars parameters are omitted, WrapText searches for space, hyphen, or tab characters on which to break the line and inserts a carriage return/line feed pair (#13#10) at the break points.
var s : string;
s:='BreakStr is inserted in the string after
a series of BreakChar characters at the end
of the line, to create a line break.';
s := WrapText(s, #13#10, ['.',' ',#9,'-'], 30);
//s=BreakStr is inserted in the
// string after a series of
// BreakChar characters at the
// end of the line, to create
// a line break.
|
String Types in Delphi
Understanding and managing string data types in Delphi's Object Pascal. Learn about differences between Short, Long, Wide and null-terminated strings.
|
Free Delphi code snippet inside every Delphi Newsletter! |
|
|
|
Got some code to share? Got a question? Need some help? |
|
|