Android Question Help to remove caracters in a variable

Nkalampika

Active Member
Licensed User
hello I want to remove special characters. and keep figures how to do it? example: private var = "123aaa45" as string
I want to keep numbers
 

Nkalampika

Active Member
Licensed User
I have a varaible:
x = "t 196.01"
I want x to give
x = "196.01" I want to keep the point
 

Mahares

Well Known Member
Licensed User
In your example, voici le resultat:
B4X:
Dim MyString As String ="t 196.01"
    Log(Regex.Replace("[^0-9.]",MyString,""))   'returns: 196.01
 
Top