Beispiel #1
0
        public static string FullTextFormat(string text, FullTextFormat flags)
        {
            if ((flags & UnityEngine.UI.Windows.Components.FullTextFormat.LowerAll) != 0)
            {
                text = text.ToLower();
            }

            if ((flags & UnityEngine.UI.Windows.Components.FullTextFormat.UpperAll) != 0)
            {
                text = text.ToUpper();
            }

            if ((flags & UnityEngine.UI.Windows.Components.FullTextFormat.TrimLeft) != 0 ||
                (flags & UnityEngine.UI.Windows.Components.FullTextFormat.Trim) != 0)
            {
                text = text.TrimStart();
            }

            if ((flags & UnityEngine.UI.Windows.Components.FullTextFormat.TrimRight) != 0 ||
                (flags & UnityEngine.UI.Windows.Components.FullTextFormat.Trim) != 0)
            {
                text = text.TrimEnd();
            }

            if ((flags & UnityEngine.UI.Windows.Components.FullTextFormat.Percent) != 0)
            {
                text = string.Format("{0}%", text);
            }

            if ((flags & UnityEngine.UI.Windows.Components.FullTextFormat.UpperFirstLetter) != 0)
            {
                text = text.UppercaseFirst();
            }

            if ((flags & UnityEngine.UI.Windows.Components.FullTextFormat.UppercaseWords) != 0)
            {
                text = text.UppercaseWords();
            }

            return(text);
        }