Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to find a string inside another string using Javascript

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 354
    Comment on it

    Suppose you have two strings and you need if they contains same words. Then in this case you have to use 'strName.indexOf' function.
    Let's consider the example below:-

    var MyString= "I'm explaining string match on findnerd portral";
     var Find = MyString.indexOf("findnerd"); 
     alert(Find );
    

    Output

    22
    
     //It will alert 11, -1 if not found
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: