Android Question Extract Number from alphanumeric string

trepdas

Active Member
Licensed User
B4X:
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:
oldstring = "AND051"
newstring = "AND"
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…