Tokenize a string: Difference between revisions

no edit summary
(CoffeeScript)
No edit summary
Line 534:
END PROGRAM Example</lang>
 
=={{header|Free Pascal/Lazarus}}==
<lang pascal>
program TokenizeString;
 
{$mode objfpc}{$H+}
 
const
CHelloStr = 'Hello,How,Are,You,Today';
var
I: Integer;
VResult: string = '';
begin
for I := 1 to Length(CHelloStr) do
begin
if CHelloStr[I] = ',' then
VResult += LineEnding
else
VResult += CHelloStr[I];
end;
WriteLn(VResult);
end;
</lang>
 
The result is:
<lang pascal>
Hello
How
Are
You
Today
</lang>
'''Credits''': [http://code.google.com/p/lazsolutions/ silvioprog], --[[Special:Contributions/201.92.16.65|201.92.16.65]] 15:10, 8 January 2012 (UTC)
=={{header|GAP}}==
<lang gap>SplitString("Hello,How,Are,You,Today", ",");
Anonymous user