using System;
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)));
		}
	}
}
