Enumeration (Enum): Unable to use special characters like Plus sign in C#

Last Reply on Feb 20, 2018 03:43 AM By Mudassar

Posted on Feb 20, 2018 03:31 AM

when i create the enumeration in my class file it shows a blue underline saying end of statement expected.

Are you able to create the enumeration i sent in your visual studio class file?

only for PID+ line there is an error becuase of the plus sign.

  Public Enum IdentificationType
        <Description("Calling line identification")>
        <Description("Called number")>
        <Description("PID entered by caller")>
        <Description("PID + confirmation to caller")>
        <Description("Channel number")>

    End Enum

The value PID+ is giving me error .

How can i add a value with a + sign..




Posted on Feb 20, 2018 03:43 AM Modified on on Feb 20, 2018 03:44 AM

I already told you not possible. + sign is a operator and hence cannot be used. Rename it as PID_Plus.