116、骂战
书迷正在阅读:贵族女校 , 我和老婆的快乐性爱生活 , 老公,我是一条母狗 , 我的情人-媛 , 我的性奴是老师 , 舰C 被铃谷的抖S榨精给惩罚了 , 私奴包子自述的调教手记 , 扶他勇者莎莉亚的肉棒解放大作战 , 大奉打更人之婶婶篇 , 生化危机 对红裙高跟的高冷御姐艾达王施以淫纹制裁 , 为爱鼓掌十八室(高H 1V1 肉文甜文)全 , 大奉同人之国师蒙尘
at(obj); 052 }else{ 053 DecimalFormatdecimalFormat=newDecimalFormat(format); 054 s=decimalFormat.format(obj); 055 } 056 }else{ 057 NumberFormatnumberFormat=NumberFormat.getInstance(); 058 s=numberFormat.format(obj); 059 } 060 }catch(Exceptione){ 061 } 062 returns; 063 } 064 065 /** 066 *计算字符串四则运算表达式 067 *@paramstring 068 *@return 069 */ 070 publicstaticStringcomputeString(Stringstring){ 071 StringregexCheck=“[\\(\\)\\d\\ \\-\\*/\\.]*“;//是否是合法的表达式 072 073 if(!Pattern.matches(regexCheck,string)) 074 returnstring; 075 076 Matchermatcher=null; 077 Stringtemp=““; 078 intindex=-1; 079 Stringregex=“\\([\\d\\.\\ \\-\\*/] \\)“;//提取括号表达式 080 string=string.replaceAll(“\\s“,““);//去除空格 081 try{ 082 Patternpattern=Patternpile(regex); 083 //循环计算所有括号里的表达式 084 while(pattern.matcher(string).find()){ 085 matcher=pattern.matcher(string); 086 while(matcher.find()){ 087 temp=matcher.group(); 088 index=string.indexOf(temp); 089 string=string.substring(0,index) 090 computeStirngNoBracket(temp) 091 string.substring(index temp.length()); 092 } 093 } 094 //最后计算总的表达式结果 095 string=computeStirngNoBracket(string); 096 }catch(NumberFormatExceptione){ 097 returne.getMessage();(未完待续。)