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
 
Upvote 0

Nkalampika

Active Member
Licensed User
WhatsApp Image 2019-05-30 at 18.00.47.jpeg
 
Upvote 0

Mahares

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