I want to split over a string (exemple : ABC-{9090}) with a first and last index using java
I want to get just the value between {} --> output : 9090
I want to split over a string (exemple : ABC-{9090}) with a first and last index using java
I want to get just the value between {} --> output : 9090
You can use below replaceAll for this purpose:
public class StringParsing {
public static void main(String[] args){
String s = "ABC-{9090}";
System.out.println(s.replaceAll("[^\\{]+\\{(.*?)\\}.*", "$1"));
}
}