splitting using regex java
Pattern p = Pattern.compile("(\\d+)|([a-zA-Z]+)");
Matcher m = p.matcher("810LN15");
List<String> tokens = new LinkedList<String>();
while(m.find())
{
String token = m.group( 1 ); //group 0 is always the entire match
tokens.add(token);
}
//now iterate through 'tokens' and check whether you have a number or text
Also in Java:
- how to get multiple integer input in java
- get preference value android
- gson parse json
- read csv java android
- linux pyspark select java version
- java for
- java jagged array days and months
- how to create a constructor in java
- java resultset to table
- hide elements android
- java intercept ctrl c
- array string java in one line
- write a java program to check whether given number is binary or not
- java get location of jar file
- Unhandled exception: java.lang.InterruptedException
- java get folder content
- arraylist java methds
- changing double space to single in java script
- processing sound android
- java compareto
- java recursion
- imagesbutton how to set background
- The specified child already has a parent. You must call removeView() on the child's parent first
- counting the sequence of character in string java