How to split the string into array?
Description: The split() method is used to split a string into an array of substrings, and returns the new array. var stringArray = new Array(); here you declare new array of name stringArray. stringArray = str.split(" "); here you splitting the str and storing the value into stringArray. Now by using for loop you can easily print the array of split value of str.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.