更新时间:2023-11-06 17:20:22
var array = string.split(',');
MDN参考,主要有助于 limit
参数可能出现意外行为。 (提示:a,b,c.split(,,2)
出现在 [a,b]
,而不是 [a,b,c]
。)
MDN reference, mostly helpful for the possibly unexpected behavior of the limit
parameter. (Hint: "a,b,c".split(",", 2)
comes out to ["a", "b"]
, not ["a", "b,c"]
.)