Exemple #1
0
        /// <summary>
        ///     Go through an array, determining if TextValue contains any substrings in the array.
        ///     If it does, returns true, and updates the ValuesFound array.
        /// </summary>
        /// <param name="array"></param>
        /// <param name="textValue"></param>
        /// <param name="CaseSensitive"></param>
        /// <returns></returns>
        public static bool TextContainsArraySubstrings(string[] array, string textValue, ref string[] valuesFound)
        {
            valuesFound = new string[0];
            var esa            = new ClsEditableStringArray();
            var textValueUpper = textValue.ToUpper();
            var result         = false;

            foreach (var thisArrayValue in array)
            {
                var avUpper = thisArrayValue.ToUpper();
                if (textValueUpper.Contains(avUpper))
                {
                    result = true;
                    esa.Append(thisArrayValue);
                }
            }

            valuesFound = esa.Data;
            esa         = null;
            return(result);
        }