Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: .NET
Expertise: Beginner
Jan 10, 2017

Check if a String Contains a Phrase

The following snippet will allow you quickly determine whether or not a specified phrase exists in a string:

If (!String.IsNullOrEmpty(STRINGTOCHECK.ToString()) && STRINGTOCHECK.ToString().ToLower().Contains("PHRASETOSEARCHFOR"))
{
//Found
}
Else
{
//Not Found
}
Hannes du Preez
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date