Click or drag to resize
EnumStringRepresentationExtensionsToEnum Method (String, Type)
Converts the string representation of the enum value to the actual enum value.

Namespace: CMS.Helpers
Assembly: CMS.Helpers (in CMS.Helpers.dll) Version: 8.2.23
Syntax
C#
public static Enum ToEnum(
	this string stringRepresentation,
	Type enumType
)

Parameters

stringRepresentation
Type: SystemString
String representation of the enum value
enumType
Type: SystemType
Enum type

Return Value

Type: Enum
Returns the enum value if it is specified using the EnumStringRepresentationAttribute. Otherwise returns the default enum value.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also