I have a string like
string variable1="EXAMPLE";
and later somewhere in my code, I use like
Console.WriteLine(variable1.ToLower());
I may use variable1.ToLower()
multiple times. But now I want to store the variablename that is converted to Lower in a separate new variable, that is, I have to extract variable1
from Console.WriteLine(variable1.ToLower());
line and store it in a string variable. Is that possible?
My main goal is that, If my code has variable1.ToLower()
in too many places, then I have to run an application, that replaces all variable1.ToLower()
to a new string that has the value of variable1.ToLower()
. Please Note that using too many variable1.ToLower()
in a code is a violation.So I am just creating a new variable to store the value of variable1.ToLower()
and use that new variable instead of variable1.ToLower()
in every place.