經安全檢測,此網站為安全網站,請放心前往原始網址!

javascript - Display only 10 characters of a long string? - Stack ...

If I understand correctly you want to limit a string to 10 characters? var str = 'Some very long string'; if(str.length > 10) str = str.substring(0,10);. Something like that ...

stackoverflow.com

網址安全性掃描由 google 提供