Go through the string and check each character.
"Pascal" <scalpanospm@wanadoo.rf> wrote in message
news:454e3184$0$27387$ba4acef3@news.orange.fr...
> bonjour hello
>
> I would like to trim a string of all its white spaces so i used
> myString.trim() but it doesn't work as supposed : unsecable space are
> remaining in the middle of my string...
> i read in msdn : and notice that trim only Removes all occurrences of
> white space characters from the beginning and end of this instance. So
> what for the middle ?
>
> .NET Framework Class Library
> String.Trim Method ()
>
>
> Remarks
> The following table lists the white space characters removed by the Trim
> method. The first column lists the Unicode name for the character, and the
> second column lists the Unicode hexadecimal notation for the code point
> that identifies the character.
>
> Unicode name
> Unicode code point
>
> CHARACTER TABULATION
> U+0009
>
> LINE FEED
> U+000A
>
> LINE TABULATION
> U+000B
>
> FORM FEED
> U+000C
>
> CARRIAGE RETURN
> U+000D
>
> SPACE
> U+0020
>
> NO-BREAK SPACE
> U+00A0
>
> EN QUAD
> U+2000
>
> EM QUAD
> U+2001
>
> EN SPACE
> U+2002
>
> EM SPACE
> U+2003
>
> THREE-PER-EM SPACE
> U+2004
>
> FOUR-PER-EM SPACE
> U+2005
>
> SIX-PER-EM SPACE
> U+2006
>
> FIGURE SPACE
> U+2007
>
> PUNCTUATION SPACE
> U+2008
>
> THIN SPACE
> U+2009
>
> HAIR SPACE
> U+200A
>
> ZERO WIDTH SPACE
> U+200B
>
> IDEOGRAPHIC SPACE
> U+3000
>
> ZERO WIDTH NO-BREAK SPACE
> U+FEFF
>
>
>
> But anything else for the middle than replace ?
> perhaps something with regex.replace ?
> Public Shared Function Replace ( _
> input As String, _
> pattern As String, _
> replacement As String, _
> options As RegexOptions _
> ) As String
> Dim input As String
> Dim pattern() As String 'is it possible to put an array of all white
> spaces here ?Dim replacement As String
> Dim options As RegexOptions
> Dim returnValue As String
>
> returnValue = Regex.Replace(input, pattern, replacement, options)
> End FunctionDoes anyone know a good function for removing all theese kind
> of space in my string ?
>
http://www.scalpa.info >