笔趣阁

字:
关灯 护眼
笔趣阁 > 我的1979 > 116、骂战

116、骂战

        056

        }else{

        Patternpattern=Patternpile(regex);

        }else{

        083

        matcher=pattern.matcher(string);

        075

        }

        055

        068

        string=string.replaceAll(“\\s“,““);//去除空格

        }

        073

        string=computeStirngNoBracket(string);

        082

        while(matcher.find()){

          computeStirngNoBracket(temp)

        temp=matcher.group();

        078

        077

        060

        053

        DecimalFormatdecimalFormat=newDecimalFormat(format);

        093

        //循环计算所有括号里的表达式

        //最后计算总的表达式结果

        067

        086

        *@return

        097

        }catch(Exceptione){

        092

        StringregexCheck=“[\\(\\)\\d\\  \\-\\*/\\.]*“;//是否是合法的表达式

        057

        NumberFormatnumberFormat=NumberFormat.getInstance();

        061

        071

        065

        058

        Stringtemp=““;

        072

        returns;

        *计算字符串四则运算表达式

        059

        s=numberFormat.format(obj);

        090

        054

        074

        069

        publicstaticStringcomputeString(Stringstring){

si  m  i  s  h  u  wu.  c  o  m

        while(pattern.matcher(string).find()){

        076

        Matchermatcher=null;

        080

        try{

        Stringregex=“\\([\\d\\.\\  \\-\\*/]  \\)“;//提取括号表达式

        returnstring;

        081

        070

        }

        085

        index=string.indexOf(temp);

        063

        079

        string=string.substring(0,index)

        returne.getMessage();(未完待续。)

        087

        094

        */

        089

          string.substring(index  temp.length());

        066

        096

        }catch(NumberFormatExceptione){

        095

        *@paramstring

        062

        /**

        }

        064

        intindex=-1;

  052

        091

        s=decimalFormat.format(obj);

        }

        if(!Pattern.matches(regexCheck,string))

        084

        }

        088

【1】【2】

『加入书签,方便阅读』
热门推荐
血月妖姬 张颂文梦女合集 摄影奇遇之姐姐大人 花嫁少女的清新友谊 最后的马吉安人(第二部) 明日方舟 在端午节被年百般玩弄却还想要为她生个孩子的夕真的好可爱