Skip to content

M_CodeJam_EnumHelper_TryParse__1_1

andrewvk edited this page Jun 23, 2016 · 5 revisions

EnumHelper.TryParse(TEnum) Method (String, Boolean, TEnum)

Try to parse the enum value.

Namespace: CodeJam
Assembly: CodeJam (in CodeJam.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

C#

public static bool TryParse<TEnum>(
	string name,
	bool ignoreCase,
	out TEnum result
)
where TEnum : struct, new(), IComparable, IFormattable, IConvertible

VB

Public Shared Function TryParse(Of TEnum As {Structure, New, IComparable, IFormattable, IConvertible}) ( 
	name As String,
	ignoreCase As Boolean,
	<OutAttribute> ByRef result As TEnum
) As Boolean

F#

static member TryParse : 
        name : string * 
        ignoreCase : bool * 
        result : 'TEnum byref -> bool  when 'TEnum : struct, new() and IComparable and IFormattable and IConvertible

Parameters

 

name
Type: System.String
The name.
ignoreCase
Type: System.Boolean
If set to true the case of the name will be ignored.
result
Type: TEnum
The parsed value.

Type Parameters

 

TEnum
The type of the enum.

Return Value

Type: Boolean
true, if parsing was successful; false otherwise.

See Also

Reference

EnumHelper Class
TryParse Overload
CodeJam Namespace

Clone this wiki locally