StringExtensions.ToInt32 method

Version 1.1.28
.NET Framework 4.8
Namespace Skybrud.Essentials.Strings.Extensions
Assembly Skybrud.Essentials.dll

ToInt32(string, Guid)

Extension method

Naming of this method is wrong. Use the Skybrud.Essentials.Strings.Extensions.StringExtensions.ToGuid(System.String,System.Guid) method instead.

public static Guid ToInt32(this string input, Guid fallback)

Parameters

input String

The input string to be converted.

fallback Guid

The fallback value that will be returned if the conversion fails.

Returns

An instance of Guid .

ToInt32(string)

Extension method

Converts input to an instance of int . If the conversion fails, 0 will be returned instead.

public static int ToInt32(this string input)

Parameters

input String

The input string to be converted.

Returns

int

An instance of int .

ToInt32(string, int)

Extension method

Converts input to an instance of int . If the conversion fails, fallback will be returned instead.

public static int ToInt32(this string input, int fallback)

Parameters

input String

The input string to be converted.

fallback int

The fallback value that will be returned if the conversion fails.

Returns

int

An instance of int .