コード例 #1
0
        /// <summary>
        ///		Converts a number from any base between 2 and 36 to any base between 2 and 36.
        /// </summary>
        /// <param name="numberAsString">The number to be converted.</param>
        /// <param name="fromBase">The base from which to convert. Has to be between 2 and 36.</param>
        /// <param name="toBase">The base to which to convert. Has to be between 2 and 36.</param>
        /// <returns>The number converted from fromBase to toBase.</returns>
        public static string ToBase(string numberAsString, ushort fromBase, ushort toBase)
        {
            ulong base10 = BaseConverter.ToBase10(numberAsString, fromBase);

            return(BaseConverter.FromBase10(base10, toBase));
        }