Logo

Programming-Idioms

History of Idiom 49 > diff from v9 to v10

Edit summary for version 10 by :

Version 9

2015-08-21, 23:24:11

Version 10

2015-08-22, 21:11:17

Idiom #49 Split a space-separated string

Build list chunks consisting in substrings of input string s, separated by one or more space characters.

Idiom #49 Split a space-separated string

Build list chunks consisting in substrings of input string s, separated by one or more space characters.

Imports
Classes
Code
var
  SL: TstringList;
begin
  //assume the list is created (and freed at some later point)
  SL.StrictDelimiter := True;
  SL.Delimiter := #32; //#32 is space char
  SL.DelimitedText := 'Text containing several spaces   !';
end;