I want to create const string from another string variable. For example the next two code snippets can't compile
1)
string str = "111";
const string str2 = str;
2)
string str = "111";
const string str2 = new string(str.ToCharArray());
Which results in
Error: The expression being assigned to 'str2' must be constant
Is there any way to create a const string from string variable ?
static readonlycan help substitute.