[Gambas-user] non printable char "Ⱶ" how to remove from string!!!!!
Fabien Bodard
gambas.fr at ...626...
Tue Dec 29 10:27:35 CET 2015
Ru .. Characters > to 127 are printable... But terminals sometime
replace non printable chars by those one
2015-12-29 0:56 GMT+01:00 Ru Vuott <vuott at ...325...>:
>
>> 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 ;-)
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
--
Fabien Bodard
More information about the User
mailing list