DotNet Academy of Rajesh Rolen

Solutions by Rajesh Rolen

How to check in javascript that string contains a substring or not

many of times we need to find out that a particular string contains a particular (charactor or string ) or not.
so below example will help you.
var varA = "hello how r u";
if(varA.indexOf("How") != -1)
{
alert('it contains How');
}
else
{
alert('it not contains how');
}

Article by: Rajesh Rolen

0 comments:

Post a Comment

About this blog

My Blog List

Advertise On This Site

Site Info

Advertise on this Site

To advertise on this site please mail on RajeshRolen@gmail.com

Information Source

About

Pages

Dot Net Academy

Advertis in This Area of Site

Powered by Blogger.

Followers

Search This Blog