method
squeeze
![Wide documentation Importance_3](https://d2vfyqvduarcvs.cloudfront.net/images/importance_3.png?1349367920)
squeeze(...)
public
Builds a set of characters from the other_str parameter(s) using the procedure described for String#count. Returns a new string where runs of the same character that occur in this set are replaced by a single character. If no arguments are given, all runs of identical characters are replaced by a single character.
"yellow moon".squeeze #=> "yelow mon" " now is the".squeeze(" ") #=> " now is the" "putters shoot balls".squeeze("m-z") #=> "puters shot balls"
Register or
log in
to add new notes.
wysrd -
October 9, 2010
itsNikolay -
November 12, 2013
![Default_avatar_30](https://www.gravatar.com/avatar/956d7f2051104db302d721d71318ddee?size=30&default=http://apidock.com/images/default_avatar_30.png)
6 thanks
![Default_avatar_30](https://www.gravatar.com/avatar/a81783da80523f23803df36d4cb19d00?size=30&default=http://apidock.com/images/default_avatar_30.png)
0 thanks