我使用componentsSeparatedByString on String将长字符串拆分为字符串数组,使用逗号(,)作为要拆分的字符串。问题是,一个组件是逗号字符。例如,字符串为"a,b,c,,,1,2,3“。调用componentsSeparatedByString后,数组为"a“、"b”、"c“、"1”、"2“、"3”,但我需要它是"a“、"b”、"c“、&qu
我不明白为什么我的word[1]返回一个a而不是一个i,你能帮我理解它吗?document.write(word[1]); //returns 'a'document.write(word[1]); //returns 'a'//convert the first letter of each word of the string in upper case
var string = 'the quick