How from switch to return result return?
Method1, depending on the value of the variable "str_1", selects an additional method to execute.
I get an error:
"Using local variable" s1 ", which is not assigned a value."
Code
public string Method1(string str_1)
{
string s1;
switch (str_1)
{
case "type_1":
s1 = MethodTest();
break;
}
return s1;
}
public string MethodTest()
{
string s = "test";
return s;
}
