Quantcast
Channel: Splitting a string in java on more than one symbol - Stack Overflow
Viewing all articles
Browse latest Browse all 5

Answer by assylias for Splitting a string in java on more than one symbol

$
0
0

You can use a regular expression:

String[] tokens = input.split("[+*/=-]");

Note: - should be placed in first or last position to make sure it is not considered as a range separator.


Viewing all articles
Browse latest Browse all 5

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>