实例代码:
public static void main(String[] args) { String str="11000.00元"; Pattern pattern = Pattern.compile("(\\d+(\\.\\d+)?)"); Matcher matcher = pattern.matcher(str); if (matcher.find()) { System.out.println(matcher.group(1)); } }
实例代码:
public static void main(String[] args) { String str="11000.00元"; Pattern pattern = Pattern.compile("(\\d+(\\.\\d+)?)"); Matcher matcher = pattern.matcher(str); if (matcher.find()) { System.out.println(matcher.group(1)); } }