Constant Shared array in vb.net

user2703636 picture user2703636 · Nov 12, 2013 · Viewed 16.1k times · Source

Is there a way to create a constant shared array? The ovbious way :

Shared Const GX() As String = {"GS", "GP"}

Is not working, it says you can't use shared and const together.

If you use only const it says you can't declare a contant array in a class.

Thanks in advance

Answer

the_lotus picture the_lotus · Nov 12, 2013

I don't think it's possible. An alternative would be to use ReadOnly

Public Shared ReadOnly GX() As String = {"GS", "GP"}