开发者

Splitting a string with comma [closed]

开发者 https://www.devze.com 2023-02-27 07:41 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its cu开发者_JAVA百科rrent form.
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

精彩评论

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