[fpc-pascal] RE: Trim repeated whitespace from a string
yetanothergeek at gmail.com
Sat May 27 07:07:57 CEST 2006
> Anybody know of a function that can remove (normalize) a string
> by remove all beginning and ending whitespace
> as well as replace all repeated spaces with a single space.
> A bonus would be to remove tabs and newlines chars as well
I would convert them to spaces and let the functions above have them...
for i:=1 to length(S) do if ( S[i] in [#9..#13] ) then S[i]:=#32;
More information about the fpc-pascal