This code removes leading numbers from a string:
Test results:
Tags: strings, regex
B4X:
sub RemoveLeadingNumbers(strIn as string) as string
Return Regex.Replace("^[\d.]+\W+", strIn, "")
end sub
Test results:
B4X:
RemoveLeadingNumbers("10 Test20 -test30 /40 +50") ' Test20 -test30 /40 +50
RemoveLeadingNumbers("Test20 -test30 /40 +50") ' Test20 -test30 /40 +50
RemoveLeadingNumbers("10.12 Test20 -test30 /40 +50") ' Test20 -test30 /40 +50
RemoveLeadingNumbers("10,12 Test20 -test30 /40 +50") ' 12 Test20 -test30 /40 +50
Tags: strings, regex