コード例 #1
0
        public int GetSwiftDay(string text)
        {
            var trimmedText = text.Trim();
            var swift       = 0;

            if (NextPrefixRegex.IsMatch(trimmedText))
            {
                swift = 1;
            }
            else if (PreviousPrefixRegex.IsMatch(trimmedText))
            {
                swift = -1;
            }

            return(swift);
        }
コード例 #2
0
        public int GetSwiftMonthOrYear(string text)
        {
            var trimmedText = text.Trim().ToLowerInvariant();
            var swift       = 0;

            if (NextPrefixRegex.IsMatch(trimmedText))
            {
                swift = 1;
            }
            else if (PreviousPrefixRegex.IsMatch(trimmedText))
            {
                swift = -1;
            }

            return(swift);
        }
コード例 #3
0
        public int GetSwiftMonthOrYear(string text)
        {
            var trimmedText = text.Trim().Normalized(DateTimeDefinitions.SpecialCharactersEquivalent);
            var swift       = 0;

            if (NextPrefixRegex.IsMatch(trimmedText))
            {
                swift = 1;
            }

            if (PreviousPrefixRegex.IsMatch(trimmedText))
            {
                swift = -1;
            }

            return(swift);
        }
コード例 #4
0
        public int GetSwiftMonthOrYear(string text)
        {
            var trimmedText = text.Trim();
            var swift       = 0;

            var afterNextMatch = AfterNextPrefixRegex.Match(text);

            if (afterNextMatch.Success)
            {
                swift = 2;
            }
            else if (NextPrefixRegex.IsMatch(trimmedText))
            {
                swift = 1;
            }
            else if (PreviousPrefixRegex.IsMatch(trimmedText))
            {
                swift = -1;
            }

            return(swift);
        }
コード例 #5
0
        public bool IsCardinalLast(string text)
        {
            var trimmedText = text.Trim().Normalized(DateTimeDefinitions.SpecialCharactersEquivalent);

            return(PreviousPrefixRegex.IsMatch(trimmedText));
        }
コード例 #6
0
        public bool IsCardinalLast(string text)
        {
            var trimmedText = text.Trim();

            return(PreviousPrefixRegex.IsMatch(trimmedText));
        }