【发布时间】:2018-08-05 08:35:40
【问题描述】:
我有子字符串的功能:
$('#text').on('mouseup', function(e){
var text = "There are a lot of text";
if (text != '') {
$('.ppr .sel_text').text(text.trim().substr(0,21) + "...");
}
});
我怎样才能只得到文本字符串的开头结尾?
例如,现在的结果是“There are a lot of te...”。
我想得到:“有...文本”
【问题讨论】:
标签: javascript jquery