0
的希望字符的JavaScript字符串分成數組,以使這樣的:JS司字符串數組
"emad566"
變成這樣:
["e","m","a","d","5","6","6"]
也欲它相反成爲:
["6","6","5","d","a","m","e"]
的希望字符的JavaScript字符串分成數組,以使這樣的:JS司字符串數組
"emad566"
變成這樣:
["e","m","a","d","5","6","6"]
也欲它相反成爲:
["6","6","5","d","a","m","e"]
var arr = mystring.split("").reverse();
var str = "emad566"
arr = str.split('').reverse()
然後改編爲["6", "6", "5", "d", "a", "m", "e"]
不知道'.reverse()'。謝謝! – 11684
+1打我吧:) –
原始字符串中沒有逗號 –