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
public static Enum ToEnum(
	this string stringRepresentation,
	Type enumType


Type: SystemString
String representation of the enum value
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