Javascript String Search sub string

Description

Javascript String Search sub string


var testValue = "This is the Cookbook's test string";
var subsValue = "Cookbook";

var iValue = testValue.indexOf(subsValue); // returns value of 12, index of substring

console.log(iValue);//w w  w .jav  a2  s  .  c om



PreviousNext

Related