Nkalampika Active Member Licensed User May 30, 2019 #1 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
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
MarkusR Well-Known Member Licensed User Longtime User May 30, 2019 #2 i think regular expressions will help: https://www.b4x.com/android/forum/threads/b4x-regular-expressions-regex-tutorial.7123/ Upvote 0
i think regular expressions will help: https://www.b4x.com/android/forum/threads/b4x-regular-expressions-regex-tutorial.7123/
M Mahares Expert Licensed User Longtime User May 30, 2019 #3 B4X: Dim MyString As String ="123aaa45" Log(Regex.Replace("[^0-9]",MyString,"")) 'returns: 12345 Upvote 0
Nkalampika Active Member Licensed User May 30, 2019 #5 I have a varaible: x = "t 196.01" I want x to give x = "196.01" I want to keep the point Upvote 0
M Mahares Expert Licensed User Longtime User May 30, 2019 #7 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
In your example, voici le resultat: B4X: Dim MyString As String ="t 196.01" Log(Regex.Replace("[^0-9.]",MyString,"")) 'returns: 196.01