<分区>
Possible Duplicate:
First split then join a subset of a string
我试图将一个字符串拆分成一个数组,取出第一个元素(使用它),然后将数组的其余部分连接成一个单独的字符串。
示例:
theString = "Some Very Large String Here"
会变成:
theArray = [ "Some", "Very", "Large", "String", "Here" ]
然后我想在变量中设置第一个元素并在以后使用它。
然后我想将数组的其余部分加入到一个新字符串中。
所以它会变成:
firstElem = "Some";
restOfArray = "Very Large String Here"
我知道我可以使用 theArray[0]
作为第一个元素,但我如何将数组的其余部分连接到一个新字符串?