Browse Source

Fixed StringFormatter compile error in platform builds #84

master
chrisgregan 10 years ago
parent
commit
d6be0a1a9d
  1. 8
      Assets/Fungus/FungusScript/Scripts/StringFormatter.cs

8
Assets/Fungus/FungusScript/Scripts/StringFormatter.cs

@ -1,5 +1,4 @@
using UnityEngine; using UnityEngine;
using UnityEditor;
using System.IO; using System.IO;
using System.Collections; using System.Collections;
using System.Text; using System.Text;
@ -19,20 +18,27 @@ namespace Fungus
} }
return enumLabels; return enumLabels;
} }
public static string SplitCamelCase(string text) public static string SplitCamelCase(string text)
{ {
if (string.IsNullOrEmpty(text)) if (string.IsNullOrEmpty(text))
{
return ""; return "";
}
StringBuilder newText = new StringBuilder(text.Length * 2); StringBuilder newText = new StringBuilder(text.Length * 2);
newText.Append(text[0]); newText.Append(text[0]);
for (int i = 1; i < text.Length; i++) for (int i = 1; i < text.Length; i++)
{ {
if (char.IsUpper(text[i]) && text[i - 1] != ' ') if (char.IsUpper(text[i]) && text[i - 1] != ' ')
{
newText.Append(' '); newText.Append(' ');
}
newText.Append(text[i]); newText.Append(text[i]);
} }
return newText.ToString(); return newText.ToString();
} }
public static bool IsNullOrWhiteSpace(string value) public static bool IsNullOrWhiteSpace(string value)
{ {
if (value != null) if (value != null)

Loading…
Cancel
Save