Re: Compress spaces to one space

2012-02-21 Thread bearophile
Andrej Mitrovic: Is there a Phobos function to compress all spaces to just one space in a string? E.g. foo bar becomes: foo bar import std.string; void main() { assert( foo bar .squeeze() == fo bar ); } Bye, bearophile

Re: Compress spaces to one space

2012-02-21 Thread Andrej Mitrovic
Oh cool, it even takes an optional parameter. Thanks! On 2/21/12, bearophile bearophileh...@lycos.com wrote: Andrej Mitrovic: Is there a Phobos function to compress all spaces to just one space in a string? E.g. foo bar becomes: foo bar import std.string; void main() {

Re: Compress spaces to one space

2012-02-21 Thread Andrej Mitrovic
On 2/21/12, bearophile bearophileh...@lycos.com wrote: Andrej Mitrovic: Is there a Phobos function to compress all spaces to just one space in a string? E.g. foo bar becomes: foo bar import std.string; void main() { assert( foo bar .squeeze() == fo