このコードを実行して文字列を置き換えようとしていますが、実行すると次のエラーが表示されます
Error 1 A local variable named 'typeval' cannot be declared in this scope because it would give a different meaning to 'typeval', which is already used in a 'parent or current' scope to denote something else
これがコードです
public static string Replace(string typeval)
{
string newType = "";
string typeval = "";
if (typeval.Equals("User Service Request"))
{
newType = typeval.Replace("User Service Request", "incident");
}
else if (typeval.Equals("User Service Restoration"))
{
newType = typeval.Replace("User Service Restoration", "u_request");
}
return newType;
}