我有一个动态数组,我想排除字符串的第一部分,但我不知道第一部分之后会有多少对象,我想将它们全部包含在一个新字符串中。
string = "text.'''hi''','''who''' '''are''' '''you'''. I'm ken and you're barbie"
x = string.split("'''")[1]
我可以做些什么来将它们全部包含在内吗?像 [1..?]
我有 JQuery,但我认为没有必要,对吧?
最佳答案
转变
:
Removes the first element from an array and returns that element. This method changes the length of the array.
代码:
x = theString.split("'''");
var firstElement = x.shift();
// Now x is the shifted array.
x[0];
关于JavaScript - 拆分,选择给定数字后的所有内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10549649/