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