Logo

Programming-Idioms

History of Idiom 219 > diff from v10 to v11

Edit summary for version 11 by steenslag:
[Ruby] comment

Version 10

2020-04-26, 22:57:33

Version 11

2020-04-27, 00:05:41

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.

Extra Keywords
collapse repeated
Extra Keywords
collapse repeated
Code
t = s.squeeze(" ")
Code
t = s.squeeze(" ")
Comments bubble
Just spaces.