UnityEditor.SearchUtility.RemoveUnwantedWhitespaces C# (CSharp) Method

RemoveUnwantedWhitespaces() private static method

private static RemoveUnwantedWhitespaces ( string &searchString ) : void
searchString string
return void
        private static void RemoveUnwantedWhitespaces(ref string searchString)
        {
            searchString = searchString.Replace(": ", ":");
        }
    }

Usage Example

示例#1
0
        internal static bool ParseSearchString(string searchText, SearchFilter filter)
        {
            bool result;

            if (string.IsNullOrEmpty(searchText))
            {
                result = false;
            }
            else
            {
                filter.ClearSearch();
                string text = string.Copy(searchText);
                SearchUtility.RemoveUnwantedWhitespaces(ref text);
                bool flag = false;
                int  i    = SearchUtility.FindFirstPositionNotOf(text, " \t,*?");
                if (i == -1)
                {
                    i = 0;
                }
                while (i < text.Length)
                {
                    int num  = text.IndexOfAny(" \t,*?".ToCharArray(), i);
                    int num2 = text.IndexOf('"', i);
                    int num3 = -1;
                    if (num2 != -1)
                    {
                        num3 = text.IndexOf('"', num2 + 1);
                        if (num3 != -1)
                        {
                            num = text.IndexOfAny(" \t,*?".ToCharArray(), num3);
                        }
                        else
                        {
                            num = -1;
                        }
                    }
                    if (num == -1)
                    {
                        num = text.Length;
                    }
                    if (num > i)
                    {
                        string text2 = text.Substring(i, num - i);
                        if (SearchUtility.CheckForKeyWords(text2, filter, num2, num3))
                        {
                            flag = true;
                        }
                        else
                        {
                            filter.nameFilter = filter.nameFilter + ((!string.IsNullOrEmpty(filter.nameFilter)) ? " " : "") + text2;
                        }
                    }
                    i = num + 1;
                }
                result = flag;
            }
            return(result);
        }
All Usage Examples Of UnityEditor.SearchUtility::RemoveUnwantedWhitespaces