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