具體問題﹕
 有一備注行字段﹐從數據庫中取出來要過濾掉回車.

解决方案 »

  1.   

    private  String crtoB(String strCon) {   int SPos = 0; //开始位置
      int EPos = 0; //设定结束位置
      int totallen = strCon.length();//取得字符长度
      String strShow = "";//起始设定显示字符
      String strMid = "";     for(EPos=0;EPos<totallen;EPos++) {     char c = strCon.charAt(EPos);     if(c==13) //判断是否为复位字元     {
           if(EPos!=SPos) {         strMid = strCon.substring(SPos,EPos);
             strShow = strShow + strMid + "<br>";       }
              else {         strShow = strShow + " ";      }
             SPos = EPos +2;//将SPos所指向位置向后移动两个字元        }//c==13       }//end for      if(SPos<EPos){ //判断是否有剩余的字符         strMid =strCon.substring(SPos,EPos);
             strShow = strShow +strMid +" ";
          }      return strShow; //回传strShow变数.   }
    这个函数就行。