Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

search substring in string javascript

'a nice string'.indexOf('nice') !== -1 //true
'a nice string'.indexOf('nice', 3) !== -1 //false
'a nice string'.indexOf('nice', 2) !== -1 //true
Source by flaviocopes.com #
 
PREVIOUS NEXT
Tagged: #search #substring #string #javascript
ADD COMMENT
Topic
Name
3+5 =