开发者

remove multi-lines in text

How do I r开发者_JS百科emove line 1,2,3 and retain line 4?

Like:

  1. Programmer
  2. Business Owner
  3. Manager
  4. Marketer


you can split on linebreaks (\r and \n), then grab the last element:

textfield.text = textfield.text.split(/[\r\n]/gm).pop();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜