Android Question Split string with regex

Devv

Active Member
Licensed User
Longtime User
I'm trying to split a string
usually i use regex
but this time the split key is a vertical bar "|"
when i use this:

B4X:
sting = "firstpart|secondpart"
Regex.Split("|",sting)
b4a is thinking that | is a pattern an i', getting a wrong return value
how can i tell b4a that this is a split key and not a patters any ideas
 

DonManfred

Expert
Licensed User
Longtime User
| is a special character. Escape it! "\|"
 
Upvote 0
Top