Appspotdemo.Mono.Droid.StringHelperClass.Split C# (CSharp) Method

Split() static private method

static private Split ( this self, string regexDelimiter, bool trimTrailingEmptyStrings ) : string[]
self this
regexDelimiter string
trimTrailingEmptyStrings bool
return string[]
        internal static string[] Split(this string self, string regexDelimiter, bool trimTrailingEmptyStrings)
        {
            string[] splitArray = System.Text.RegularExpressions.Regex.Split(self, regexDelimiter);

            if (trimTrailingEmptyStrings)
            {
                if (splitArray.Length > 1)
                {
                    for (int i = splitArray.Length; i > 0; i--)
                    {
                        if (splitArray[i - 1].Length > 0)
                        {
                            if (i < splitArray.Length)
                                System.Array.Resize(ref splitArray, i);

                            break;
                        }
                    }
                }
            }

            return splitArray;
        }