Diese Methode konvertiert Strings, die in der CamelCase-Schreibweise vorliegen, in Title Case.
Beispiel:
aus CamelCase wird Camel Case
// using System.Text.RegularExpressions;
/// <summary>
/// Converts camel case to title case.
/// </summary>
/// <param name="camelCaseString">The camel case string.</param>
/// <returns></returns>
private string ConvertCamelCaseToTitleCase(string camelCaseString)
{
return Regex.Replace(camelCaseString, @"(\B[A-Z])", @" $1");
}
Kommentare zum Snippet