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