From d6be0a1a9dbbc80ba909bfd3679fb7a3921bf955 Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Tue, 24 Feb 2015 08:37:44 +0000 Subject: [PATCH] Fixed StringFormatter compile error in platform builds #84 --- Assets/Fungus/FungusScript/Scripts/StringFormatter.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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)