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