Beispiel #1
0
        /// <summary>
        /// Parses the parameter value into the internal components structure.
        /// <br>
        /// Used to update all components from a full new value, as an alternative
        /// to setting individual components. Previous component values are overwritten.
        /// </summary>
        /// <param name="value"> complete field value including separators and CRLF
        /// @since 7.8 </param>
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not allowed in .NET:
//ORIGINAL LINE: @Override public void parse(final String value)
        public override void parse(string value)
        {
            init(3);
            Component1 = SwiftParseUtils.getTokenFirst(value, ":", "/");
            Component2 = SwiftParseUtils.getTokenSecond(value, "/");
            Component3 = SwiftParseUtils.getTokenThirdLast(value, "/");
        }
Beispiel #2
0
        /// <summary>
        /// Parses the parameter value into the internal components structure.
        /// <br>
        /// Used to update all components from a full new value, as an alternative
        /// to setting individual components. Previous component values are overwritten.
        /// </summary>
        /// <param name="value"> complete field value including separators and CRLF
        /// @since 7.8 </param>
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not allowed in .NET:
//ORIGINAL LINE: @Override public void parse(final String value)
        public override void parse(string value)
        {
            init(5);
            Component1 = SwiftParseUtils.getTokenFirst(value, null, "/");
            Component2 = SwiftParseUtils.getTokenSecond(value, "/");
            string toparse = SwiftParseUtils.getTokenThirdLast(value, "/");

            if (toparse != null)
            {
                if (toparse.Length < 5)
                {
                    Component3 = toparse;
                }
                if (toparse.Length >= 5)
                {
                    Component3 = StringUtils.Substring(toparse, 0, 5);
                }
                if (toparse.Length > 5 && toparse.Length < 9)
                {
                    Component4 = StringUtils.Substring(toparse, 5 - toparse);
                }
                if (toparse.Length >= 9)
                {
                    Component4 = StringUtils.Substring(toparse, 5, 9);
                }
                if (toparse.Length > 9)
                {
                    Component5 = StringUtils.Substring(toparse, 9 - toparse);
                }
            }
        }