コード例 #1
0
 public bool IsMatchAny(IEnumerable <char> characters)
 {
     return(characters.Contains(_character, CharComparer.Get(_comparison)));
 }
コード例 #2
0
        public static ICharactersRangeDefinition CreateMatching(IEnumerable <char> characters, StringComparison comparison = StringComparison.Ordinal)
        {
            Guard.ArgNotNull(characters, nameof(characters));
            var charSet = comparison != StringComparison.Ordinal ? new HashSet <char>(characters, CharComparer.Get(comparison)) : new HashSet <char>(characters);

            if (charSet.Count == 0)
            {
                return(Empty);
            }

            if (charSet.Count == 1)
            {
                return(CreateMatching(charSet.Single(), comparison));
            }

            return(new CharSet(charSet.AsReadOnly()));
        }
コード例 #3
0
 public bool IsMatch(char character)
 {
     return(CharComparer.Get(_comparison).Equals(_character, character));
 }