Corrado,
The Trim method only works on the outermost characters of a string. Once it
gets to a character that isn't supposed to be trimmed then it stops
searching. Change your string to "BBB2BBBABCD123E222B222" and you'll see
what I mean.
If you want to remove a character then use the Replace() method.
Dim sRes As String = sTxt.Replace("B","")
--
Moving from VB6 to VB.NET? It just got easier...
"The .NET Languages: A Quick Translation Guide"
www.bischofsystems.com/vbnet.asp
Quote:
> Can somebody explain me why Trim does not removes "B" and "2" chars from
> sTxt string?
> Dim sTxt As String = "ABCD123E"
> Dim aChars() As Char = {"B"c, "2"c}
> Dim sRes As String = sTxt.Trim(aChars)
> Debug.WriteLine(sRes)
> TIA
> Corrado