提取数字有关问题
提取数字问题
有字符串"http://www.aa.com/php/index.php?number=100&tag=100"
我想提取number=后面的数字该怎么提取亚
------解决方案--------------------
有字符串"http://www.aa.com/php/index.php?number=100&tag=100"
我想提取number=后面的数字该怎么提取亚
------解决方案--------------------
- Java code
public static void main (String args[]) { String str = "http://www.aa.com/php/index.php?number=120&tag=100"; int a = Integer.parseInt(str.replaceAll(".*number=(\\d+).*", "$1")); System.out.println(a); }
------解决方案--------------------