Click here to Skip to main content
15,887,135 members
Articles / Programming Languages / C#

How to Toggle String Case in .Net

Rate me:
Please Sign up or sign in to vote.
5.00/5 (14 votes)
9 Feb 2011CPOL 17.3K   9  
This one should outperform both the other methods for longer strings because of the StringBuilder.string s = "AbCdEfGhI§$%&/()1234567890";var sb = new StringBuilder(s.Length);foreach (char c in s) sb.Append(char.IsUpper(c) ? char.ToLower(c) : char.ToUpper(c));s =...

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
Germany Germany
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions