using System.Text;

namespace ControlExplorer.Controls.Chart
{
    public static class Utils
    {
        public static string SeparateWords(string input)
        {
            var strBuilder = new StringBuilder();
            bool wasNumber = false;
            foreach (char ch in input)
            {
                if (char.IsUpper(ch))
                    strBuilder.Append(" ");

                if (char.IsNumber(ch))
                {
                    if (!wasNumber)
                    {
                        strBuilder.Append(" ");
                        wasNumber = true;
                    }
                }
                else 
                {
                    wasNumber = false;
                }

                strBuilder.Append(ch);
            }
            return strBuilder.ToString();
        }
    }
}
