gpt4 book ai didi

JavaScript - 拆分,选择给定数字后的所有内容

转载 作者:行者123 更新时间:2023-11-30 08:59:27 28 4
gpt4 key购买 nike

我有一个动态数组,我想排除字符串的第一部分,但我不知道第一部分之后会有多少对象,我想将它们全部包含在一个新字符串中。

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/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com