.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> Regular Expressions >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Regular Expression to check string Value

Posted By:Amit Mehra       Posted Date: November 25, 2008    Points: 10    Category: Regular Expressions    URL: http://www.dotnetspark.com  
 

Below is the function used to check the wether the given word is complete string or not. This function return you the boolean value as a result. Lets see the code.

Regex class is available at system.Text.RegularExpression so you have to add below namespace

using System.Text.RegularExpressions;

private static bool CheckString(string str)

{

return Regex.Match(str.Trim(), "^[a-zA-Z]*$").Success;

}


     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend