Esempio n. 1
0
 public static bool TryParse(string s, IFormatProvider provider, out Sofinummer result)
 {
     return TryParse(s, out result);
 }
Esempio n. 2
0
        /// <summary>
        /// Tries to parse the supplied string into the supplied <see cref="Sofinummer"/> object.
        /// </summary>
        /// <param name="s">The string to parse.</param>
        /// <param name="result">The <see cref="Sofinummer"/> object.</param>
        /// <returns>True if the parsing is successful, false otherwise.</returns>
        public static bool TryParse(string s, out Sofinummer result)
        {
            if (string.IsNullOrEmpty(s))
            {
                result = Empty;
                return true;
            }

            if (!IsValidSofinummer(s))
            {
                result = Empty;
                return false;
            }

            result = new Sofinummer(s);
            return true;
        }