コードは次のようになります。
function TrimLength(text, maxLength) {
text = $.trim(text);
if (text.length > maxLength) {
text = text.substring(0, maxLength - ellipsis.length)
return text.substring(0, text.lastIndexOf(" ")) + ellipsis;
}
else
return text;
}
私が抱えている問題は、次のことを行うことです。
hello world and an...
The curse of the gaming backlog –...
代わりに次のことを確認したい:
hello world and...
The curse of the gaming backlog...
(a、b、c、dなど)のようなアルファベット文字があり、特殊文字がないことを確認する必要があると思います。
どんな種類の助けも大歓迎です