I want to split a string in Java with the following format: "value^1" so that I get the initial part, "value" in a string.
I wanted to use split instead of substring, so I tried this:
string.split("^")[0]
but unfortunately ^ is a special character and I guess it has to be escaped. I tried split("\^") but no luck.
Anybody knows how to achieve this using split?
Thanks!