Skip to content

M_CodeJam_EnumHelper_TryParse__1_1

Andrew Koryavchenko edited this page Jun 17, 2018 · 5 revisions

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

Try to parse the enum value.

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

Syntax

C#

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

VB

Public Shared Function TryParse(Of TEnum As {Structure, New}) ( 
	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()

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