예제 #1
0
        private static List <FlagValue> ParseNumberFlagsInOrder(StringSlice text)
        {
            if (text.IsEmpty)
            {
                return(new List <FlagValue>(0));
            }

            var textParts = text.SplitOnComma();

            var flags = new List <FlagValue>(textParts.Count);

            for (var i = 0; i < textParts.Count; i++)
            {
                if (TryParseNumberFlag(textParts[i], out FlagValue value))
                {
                    flags.Add(value);
                }
            }

            return(flags);
        }
예제 #2
0
        internal static List <FlagValue> ParseNumberFlagsInOrder(StringSlice text)
        {
            if (text.IsNullOrEmpty)
            {
                return(new List <FlagValue>(0));
            }

            var textParts = text.SplitOnComma();

            var flags = new List <FlagValue>(textParts.Length);

            for (var i = 0; i < textParts.Length; i++)
            {
                FlagValue value;
                if (TryParseNumberFlag(textParts[i], out value))
                {
                    flags.Add(value);
                }
            }

            return(flags);
        }