how to: remove unequal white spaces with trim method

  • Thread starter Thread starter Jan
  • Start date Start date
J

Jan

Hi,

Is there a way to remove the white spaces between text?

For example:

"Section 1 is oke fine"

I want it to be,

"Section 1 is oke fine"

I know the method trim, but only for equal spaces. Can I use it for
unequal white spaces?

Thanx
 
I think you're going to have to write your own algorithm to do it... it's
not hard.
I love problems like this.... they're always good excercises.

You can probably use regular expressions to do it too.. I dunno... I prefer
hardcore algorithms to do stuff like this.
 
Jan said:
Is there a way to remove the white spaces between text?

For example:

"Section 1 is oke fine"

I want it to be,

"Section 1 is oke fine"

\\\
MsgBox(System.Text.RegularExpressions.Regex.Replace("Foo bar Goo", "
( )*", " "))
///
 
Back
Top