programming-examples/js/String/Split a string and convert it into an array of.js

4 lines
144 B
JavaScript
Raw Normal View History

2019-11-15 12:59:38 +01:00
string_to_array = function (str) {
return str.trim().split(" ");
};
console.log(string_to_array("Robin Singh"));