开发者

Splitting a string with comma [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its cu开发者_JAVA百科rrent form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

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(",");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜