Candor.StringExtensions.TrimNotIn C# (CSharp) Method

TrimNotIn() public static method

Trims any characters from the start and end of a string that is not in the supplied list.
public static TrimNotIn ( this text, IList chars ) : string
text this The text to be scanned.
chars IList The characters to be kept, such as a LexicalCharacterSet characters list.
return string
        public static string TrimNotIn(this string text, IList<char> chars)
        {
            return text.TrimEndNotIn(chars).TrimStartNotIn(chars);
        }