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
Post a Comment