开发者

Delete characters after the second space using jquery?

开发者 https://www.devze.com 2023-03-14 11:31 出处:网络
I have a list of documents that start like this... MR 100 12.12.10 MR 100 11.12.10 MR 201 03.06.08 MR 458 04.06.09

I have a list of documents that start like this...

MR 100 12.12.10
MR 100 11.12.10
MR 201 03.06.08
MR 458 04.06.09

How do I get the document names to only show MR 100 and disregard everything after the second s开发者_运维百科pace using jquery?


You can format the name using split() slice() and join():

var s = "MR 100 12.12.10".split(" ").slice(0,2).join(" ");

How you can select each document title depends on how you have your page setup.

0

精彩评论

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

关注公众号