Search code examples
enumsescapingidentifierballerina

Escaping special characters in Ballerina


I need to define a MembershipStatus Enum as depicted below.

public enum MembershipStatus {
    INVITED,
    REGISTERED, 
    DEACTIVATED, 
    RE-INVITED
}

It says operator '-' not defined for 'string'. What is the correct way of specifying RE-INVITED?


Solution

  • You can escape with the character \, something like this RE\-INVITED