Sometimes you may need to convert an enum to a string without using switch or if else blocks. Here’s a generic way of converting any UEnum to FString:
UENUM(BlueprintType)
enum class MyEnum : uint8
{
None UMETA(DisplayName = "(none)"),
Quarter UMETA(DisplayName = "1/4")
}
auto MyEnumValue=MyEnum::Quarter;
//This will get the "DisplayName" of the Enum. Eg "1/4)
UEnum::GetDisplayValueAsText(MyEnumValue).ToString();
//This gets the Name of the enum, eg "Quarter"
UEnum::GetValueAsString(MyEnumValue);