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

Top 5 Contributors of the Month
Gaurav Pal

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

 Subscribe to Code Snippets

Remove lowercase from set of String

Posted By:Ravi Ranjan Kumar       Posted Date: June 29, 2011    Points: 40    Category: Regular Expressions    URL: http://www.dotnetspark.com  

This Code Snippets enable you to learn how to remove lower case words from a set of string values.

Import given namespace  
using System.Text.RegularExpressions;
then use following method 

   public static string RemoveLowercase(string str)
            Regex regex = new Regex("[^A-Z]");
            string res = regex.Replace(str, "");
            return res;
we can use given method as given below 

string str = RemoveLowercase("DotNetSpark");
after that str will hold only DNS 


Further Readings:


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