search a word and separate in 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']
*
*/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")];var data = "Welcome to Stack Overflow";
console.log(data.split(" ").splice(1));
Also in JavaScript:
- jquery infinite scroll
- number to array javascript
- shorthand function javascript multiple parameters
- javascript change page title
- What is strict mode in Java Script ?
- js set iframe src
- are you sure you want to proceed click ok button javascript code
- string comparison in javascript
- client timezone offset in JavaScript
- node js read file from s3 bucket
- jquery get ip
- pass params react js
- closures in javascript
- javascript get a random number with 6 digits
- stream recording javascript
- detect if user is online react
- node js mongoose text index
- button style in jquery datatable
- nodejs map
- js check if array
- foreach jquery
- javascript arrays codeburst
- promise nodejs
- swift append to array