Answers for "how to use split method in java for multiple things"

2

java split for multiple characters

String input = "Hi,X How-how are:any you?";
String[] parts = input.split("[\\W]");
Posted by: Guest on June-02-2020
0

splitting text with several condition in java

Pattern pattern = Pattern.compile("(\\w+)([<=>]+)(\\w+)");
    Matcher matcher = pattern.matcher("var1>=ar2b");

    if(matcher.find()){
        System.out.println(matcher.group(1));
        System.out.println(matcher.group(2));
        System.out.println(matcher.group(3));
    }
Posted by: Guest on July-10-2020

Code answers related to "how to use split method in java for multiple things"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language