S strupp01 Active Member Licensed User Longtime User Jul 12, 2017 #1 I want to separate a string at the decimal point into two strings with the command 'Regex.split'. This does not seem to work. Example: '123.456 cm' split into '123' and '456 cm' Dim str () As String = Regex.split (".", "123.456 cm") Someone knows why?
I want to separate a string at the decimal point into two strings with the command 'Regex.split'. This does not seem to work. Example: '123.456 cm' split into '123' and '456 cm' Dim str () As String = Regex.split (".", "123.456 cm") Someone knows why?
derez Expert Licensed User Longtime User Jul 12, 2017 #2 You have to escape the character, it is a special one: Regex.split ("/.", "123.456 cm") Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Jul 12, 2017 #3 strupp01 said: Someone knows why? Click to expand... I know. '.' is a special character in regex patterns (= match everything). You need to escape it: B4X: Dim str() As String = Regex.Split("\.", "123.456 cm") Upvote 0
strupp01 said: Someone knows why? Click to expand... I know. '.' is a special character in regex patterns (= match everything). You need to escape it: B4X: Dim str() As String = Regex.Split("\.", "123.456 cm")
S strupp01 Active Member Licensed User Longtime User Jul 12, 2017 #4 Thank you. I would never have thought of it. Thats how it works. Upvote 0