java - How to split a character without removing it (regex) -


this question has answer here:

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

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -