History of Idiom 219 > diff from v6 to v7
Edit summary for version 7 by Bart:
[Pascal] Updated comment
[Pascal] Updated comment
↷
Version 6
2020-02-29, 15:40:41
Version 7
2020-02-29, 15:42:47
Idiom #219 Replace multiple spaces with single space
Create string t from the value of string s with each sequence of spaces replaced by a single space.
Explain if only the space characters will be replaced, or the other whitespaces as well: tabs, newlines.
Idiom #219 Replace multiple spaces with single space
Create string t from the value of string s with each sequence of spaces replaced by a single space.
Explain if only the space characters will be replaced, or the other whitespaces as well: tabs, newlines.
Comments bubble
Using setlength twice and accessing individual characters of the result is faster than adding characters one at a time.
Comments bubble
Using setlength twice and accessing individual characters of the result is faster than adding characters one at a time.
More elaborate, but faster than the RegEx and StringReplace solutions.