[Gambas-user] non printable char "Ⱶ" how to remove from string!!!!!
Ru Vuott
vuott at ...325...
Tue Dec 29 00:56:10 CET 2015
> and Ru Vuott thanks for suggestion i'll try later
If the string has 2 or more no-printable characters, you have to modify my code, so:
Public Sub Main()
Dim s As String = "ab" & Chr(180) & "cd ef" & Chr(185) & "g" & Chr(195) & "hil" & Chr(179) & " mnop"
Dim bb As Byte[]
Dim b As Byte
Dim i As Integer
Print s
With bb = Byte[].FromString(s)
i = .Count
End With
While b < i
If Not IsAscii(Chr(bb[b])) Then
bb.Remove(b)
Dec i
Endif
Inc b
Wend
s = bb.ToString(0, bb.count)
Print s
End
****************************************************
Saludosss ;-)
More information about the User
mailing list