java - How to split a character without removing it (regex) -
this question has answer here:
- how split string, keep delimiters? 22 answers
i want split string @ point, keep character i'm splitting at. example:
input: a:b output: : b is there anyway can use java's split() method? :)
you can use stringtokenizer class in java.
stringtokenizer stk = new stringtokenizer(inputstr,":", true); this return tokens delimiter.
Comments
Post a Comment