Android Question Extract Number from alphanumeric string

https://regex101.com/ is good for exploring regular expressions (and for building them, too ;-) eg:

upload_2019-6-6_0-57-48.png
 
Upvote 0
Code: Copy
Dim s As String = "AND051"
Dim m As Matcher = Regex.Matcher("\d+", s)
If m.Find Then
   Dim number As Int = m.Match
   Log(number)
End If


How would I delete the numbers from the strings and keep only the "AND" ?
B4X: Copy
oldstring = "AND051"
newstring = "AND"
 
Upvote 0
Back
Top