Answers for "search a word and separate in javascript"

43

string split javascript

var myString = "An,array,in,a,string,separated,by,a,comma";
var myArray = myString.split(",");
/* 
*
*  myArray :
*  ['An', 'array', 'in', 'a', 'string', 'separated', 'by', 'a', 'comma']
*
*/
Posted by: Guest on October-27-2020
0

js split string

var myString = "Hello World!";

// splitWords is an array
// [Hello,World!]
var splitWords = myString.split(" ");

// e.g. you can use it as an index or remove a specific word:
var hello = splitWords[splitWords.indexOf("Hello")];
Posted by: Guest on September-30-2020
0

search a word and separate in javascript

var data = "Welcome to Stack Overflow";
console.log(data.split(" ").splice(1));
Posted by: Guest on December-01-2020

Code answers related to "search a word and separate in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language