delphi - Split strings with TStrings, omitting CRLF delimiter -
delphi - Split strings with TStrings, omitting CRLF delimiter -
i have string 'aaa'+#$0d+#$0a+'bbb'+#$01d+'ccc'
. need split according #$1d character like:
'aaa'+#$0d+#$0a+'bbb' 'ccc'
i'm using function:
procedure split(delimiter: char; str: string; listofstrings: tstrings) ; begin listofstrings.clear; listofstrings.delimiter := delimiter; listofstrings.delimitedtext := str; listofstrings.strictdelimiter:= true; end; ... split(#$1d,'aaa'+#$0d+#$0a+'bbb'+#$01d+'ccc',sl);
unfortunately splits according crlf don't need.
how have strings spited #$1d?
you have set listofstrings.strictdelimiter:= true;
before setting of property delimitedtext.
listofstrings.strictdelimiter:= true; listofstrings.delimitedtext := str;
delphi delphi-2007
Comments
Post a Comment