I'm looking to split a string at the first ':', to prevent issues if the second part of the string contains a ':'. I've been looking at Regexes, but am still having some issues, can somebody give me a hand?
Thanks.
You can use the overload of split that takes a limit parameter:
String[] result = s.split(":", 2);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With