Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How to extract integers from strings with JAVA
How to extract integers from strings with JAVA
Extracting integers from strings in java is too inefficient to compare strings one by one, so you need to use regular expressions for matching, as shown in the following code:

String? str? =? "Amount: 88,687,594 yuan";

Pattern? p? =? Pattern.compile("\\d+(,\ \ d { 3 })*);

Stick figure? m? =? p . matcher(str);

if(m.find()){

system . out . println(m . group());

}