diff --git a/Assets/Fungus/FungusScript/Scripts/StringFormatter.cs b/Assets/Fungus/FungusScript/Scripts/StringFormatter.cs index 171d413b..9617a99f 100644 --- a/Assets/Fungus/FungusScript/Scripts/StringFormatter.cs +++ b/Assets/Fungus/FungusScript/Scripts/StringFormatter.cs @@ -1,5 +1,4 @@ using UnityEngine; -using UnityEditor; using System.IO; using System.Collections; using System.Text; @@ -19,20 +18,27 @@ namespace Fungus } return enumLabels; } + public static string SplitCamelCase(string text) { if (string.IsNullOrEmpty(text)) + { return ""; + } + StringBuilder newText = new StringBuilder(text.Length * 2); newText.Append(text[0]); for (int i = 1; i < text.Length; i++) { if (char.IsUpper(text[i]) && text[i - 1] != ' ') + { newText.Append(' '); + } newText.Append(text[i]); } return newText.ToString(); } + public static bool IsNullOrWhiteSpace(string value) { if (value != null)