我在javascript中的数组有问题。我有这个数组:
Subjects[]:
[0] = 'Introduction to interesting things'
[1] = 'Cats and dogs'
[2] = 'I can't believe it's not butter Á machine lord'
[3] = 'I Intergalactic proton powered advertising droids '
如您所见,在 Subjects[2] 中,有 2 个字符串
'I can't believe it's not butter' and 'Á machine lord'
此外,在 Subjects[3] 中,字符串以 'I' 开头,应该是
'Á machine lord I'.
有没有办法剪切大写开始的字符串并为字符串创建一个新索引?像这样:
Subjects[]:
[0] = 'Introduction to interesting things'
[1] = 'Cats and dogs'
[2] = 'I can't believe it's not butter'
[3] = 'Á machine lord I'
[4] = 'Intergalactic proton powered advertising droids'
我试过使用.split
没有成功。任何帮助都会很有用。