public static void main(String[] args) {
String s =" 湘菜馆\r\n==菜名============价格=======\r\n凉皮\t\t25.90\r\n韭菜鸡蛋\t\t26.80\r\n烤鱼\t\t88.80 \r\n===========================";
String a ="[^(\\d\\.)]+";
String[] nstr = s.split(a);
double sum=0;
for (int i = 0; i < nstr.length; i++) {
System.out.println(nstr[i]+" 15");
}
结果为
15
21.90 15
22.80 15
58.80 15
有办法消除nstr【0】吗???? |
|