ThisToThat/ThisToThat/ToUInt16Extensions.cs
/// <summary>
/// Converts and returns this string's value as UInt16.
/// The default value passed in is returned if the string does not successfully parse to UInt16.
/// </summary>
/// <returns>This string converted to UInt16, or the default value if conversion unsuccessful.</returns>
Converts and returns this string's value as UInt16.
The default value passed in is returned if the string does not successfully parse to UInt16.
Converts and returns this string ' s value as UInt16 . The default value passed in is returned if the string does not successfully parse to UInt16 .
public static UInt16 ToUInt16OrDefault(this string strThisString, UInt16 uint16Default = default(UInt16))
        {
            UInt16 uint16Return;
            return UInt16.TryParse(strThisString, out uint16Return) ? uint16Return : uint16Default;
        }
public static UInt16 ToUInt16OrDefault ( this string strThisString , UInt16 uint16Default = default ( UInt16 ) ) { UInt16 uint16Return ; return UInt16 . TryParse ( strThisString , out uint16Return ) ? uint16Return : uint16Default ; }
Converts and returns this string's value as UInt16.
Converts and returns this string ' s value as UInt16 .
This string converted to UInt16, or the default value if conversion unsuccessful.
This string converted to UInt16 or the default value if conversion unsuccessful .
string
this
uint16Default
UInt16