Splitting a string with comma [closed]
Is there any way to split a string with comma str.split(",")
will give same string?
Also var t = str.split("#")
let #
be any character, then what is value of t
? I know split()
returns an array.
var arr = str.split(",");
This will result in an array. The string representation is the array, joined by a comma (,
). To turn this array in a string again, use the array.join(separator)
function:
var str = arr.join(",");
精彩评论