xingquan

转自:http://dev.mjxy.cn/a-Javascript-Remove-control-character-from-string.aspx

// Remove control character from a string

function removeNL(s)
{
     // NewLine, CarriageReturn and Tab characters from a String
     // will be removed and will return the new string

     r = "";
     for (i = 0; i < s.length; i++)
     {
         if (s.charAt(i) != \'\n\' & s.charAt(i) != \'\r\' & s.charAt(i) != \'\t\') {
             r += s.charAt(i);
         }
     }

     return r;
}

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-01-03
  • 2021-12-19
  • 2022-01-06
  • 2021-10-19
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案