Logo

Programming-Idioms

History of Idiom 219 > diff from v9 to v10

Edit summary for version 10 by steenslag:
New Ruby implementation by user [steenslag]

Version 9

2020-03-02, 17:19:23

Version 10

2020-04-26, 22:57:33

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(" ")