Files
2018-10-16 21:32:40 +05:30

500 B

title, localeTitle
title localeTitle
Split a String into an Array Using the split Method 使用split方法将字符串拆分为数组

使用split方法将字符串拆分为数组

方法

只需拆分字符串即可创建一个新的单词数组。

可以使用简单的正则表达式来实现此结果。

function splitify(str) { 
  // Add your code below this line 
  return str.split(/\W/); 
  // Add your code above this line 
 } 
 splitify("Hello World,I-am code");