| public String strNowtime() { String dateString="123"; try { java.text.SimpleDateFormat formatter=new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); java.util.Date currentTime_1=new java.util.Date(); dateString=formatter.format(currentTime_1); } catch(Exception e) { } return dateString; } //--------------------------去掉html--------------------------- public String HTMLEncode(String Str) { Str=ebbReplace(Str,"<","<"); Str=ebbReplace(Str,">",">"); Str=ebbReplace(Str,"\n","<BR>"); return Str; } //--------------------------替换变量--------------------------- public String ebbReplace(String Str,String oldStr,String newStr) { String ReturnStr=""; int i,j,t,m,n; n=0; j=oldStr.length(); if (Str.indexOf(oldStr)>-1) { while(Str.indexOf(oldStr,n)>-1) { i=Str.length(); if (Str.indexOf(oldStr)==0) Str=newStr+Str.substring(j,i); else { t=Str.indexOf(oldStr); m=(t+j); Str=Str.substring(0,t)+newStr+Str.substring(m,i); n=t+newStr.length()-j+1; } } } 上一页 [1] [2] [3] [4] [5] 下一页 |