17 lines
365 B
C#
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)));
|
|
}
|
|
}
|
|
}
|