Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何获得日文字符串的真实长度?例如,该length()函数将返回字节长度,而不是实际长度。
length()
s = ""; alert(s.length); // '2'
有没有办法获得在这种情况下为 1 的实际长度?