I have a piece of code that iterates over XML attributes:
string groupName;
do
{
switch (/* ... */)
{
case "NAME":
groupName = thisNavigator.Value;
break;
case "HINT":
// use groupName
But this way I get the error of using an unassigned variable. If I assign something to groupName then I cannot change it because that's how the strings work in C#. Any workarounds ?