Alternatives
Members may post updates or alternatives to this current article in order to show different
approaches or add new features.
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...
14 Jun 2011Steve 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(); ...
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.