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(4);
            Component1 = SwiftParseUtils.getTokenFirst(value, "/", "/");
            string toparse = SwiftParseUtils.getTokenSecondLast(SwiftParseUtils.removePrefix(value, "/"), "/");

            if (toparse != null)
            {
                if (toparse.Length >= 4)
                {
                    setComponent2(StringUtils.Substring(toparse, 0, 4));
                }
                if (toparse.Length >= 5)
                {
                    Component3 = StringUtils.Substring(toparse, 4, 5);
                }
                if (toparse.Length > 5)
                {
                    setComponent4(StringUtils.Substring(toparse, 5 - toparse));
                }
            }
        }