Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个字符串,其中包含在字符串中用逗号分隔的值,我想像使用 PHP 爆炸一样获取每个值,但我需要在 JavaScript 中完成。有没有办法,怎么做?
谢谢
勒龙
怎么样:
"some,string,with,commas".split(',')
var mystring = "I like coffee, very much so, but I don't like..."; var exploded = mystring.split(","); window.alert(exploded[1]);