Home > Web Front-end > JS Tutorial > 取得一定长度的内容,处理中文_javascript技巧

取得一定长度的内容,处理中文_javascript技巧

WBOY
Release: 2016-05-16 19:23:20
Original
887 people have browsed it
复制代码 代码如下:

//字符 长度
function xLength(m,n)
{
if(m==null || m=="")return ""
var s=m.replace(/([^\x00-\xff])/g,"\x00$1");
return (s.length}
http://3http.com/
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template