Click here to Skip to main content
Click here to Skip to main content
Articles » Languages » C# » General » Alternatives
 

Tagged as

Go to top

Pascal and Camel Case to Display Text Conversion

, 8 Jun 2011
Why not take care of the first character before the loop, instead of checking it every time (not that it makes a big difference on modern hardware)? This also moves the char declaration out of the loop.private string createDisplayText(string propertyName){ if...

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

8 Jun 2011
Ben Kotvis
2 alternatives  
Pascal and Camel Case to display text conversion
14 Jun 2011
Steve Roberson
This version treats the input string as an indexed string. The code is a little shorter.private string createDisplayText(string propertyName){ if (String.IsNullOrEmpty(propertyName)) { return String.Empty; } StringBuilder builder = new StringBuilder(); ...

License

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

Share

About the Author

kiswa00
Software Developer
United States United States
No Biography provided

| | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 8 Jun 2011
Article Copyright 2011 by kiswa00
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid