Files
LeafWeb/Core/Utility/StringExtensions.cs
T
2015-12-04 10:15:51 -05:00

17 lines
365 B
C#

using System.Globalization;
using System.Linq;
namespace LeafWeb.Core.Utility
{
public static class StringExtensions
{
public static string SplitCamelCase(this string str)
{
return str.Aggregate(
string.Empty,
(current, c) =>
current + (char.IsUpper(c) && current.Length > 0 ? " " + c : c.ToString(CultureInfo.InvariantCulture)));
}
}
}