Click here to Skip to main content
Click here to Skip to main content

How to Toggle String Case in .Net

This one should outperform the both 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 = sb.ToString();I...
This is an old version of the currently published tip/trick.

This article is still being written and is not currently available for general viewing.

Please go to the Programming Tips Table of Contents to view the list of available articles in this section.
| Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 9 Feb 2011
Article Copyright 2011 by Robert Rohde
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid