Is there a javascript method to find out if a string is part of another string? -


i need find out if 1 string in , return true or false, or similar.

just remembered having read indexof returning -1 if doesn't find something?

use indexof function of string:

var str = "something"; var other = "thi"; if (str.indexof(other) != -1) {     // other part of original string. } 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -