p; e.printStackTrace(); } return rtncd; } public void close(){ try{ if(stmt!=null)stmt.close(); if(conn!=null)conn.close(); } catch(SQLException e){ e.printStackTrace(); } } public String replaSbstr(String strSource,String strFrom,String strTo){ if (strSource == null) { return null; } int i = 0; if ((i = strSource.indexOf(strFrom, i)) >= 0) { char[] cSrc = strSource.toCharArray(); char[] cTo = strTo.toCharArray(); int len = strFrom.length(); StringBuffer buf = new StringBuffer(cSrc.length); buf.append(cSrc,0,i); buf.append(cTo); //buf.append(cSrc, 0, i).append(cTo); i += len; int j = i; while ((i = strSource.indexOf(strFrom, i)) > 0) { buf.append(cSrc,j,i-j); buf.append(cTo); //buf.append(cSrc, j, i - j).append(cTo); i += len; j = i; } buf.append(cSrc, j, cSrc.length - j);  上一页 [1] [2] [3] [4] 下一页 |