I am passing a message from a server that gets stored into a string variable called strObject. I wish to convert the string inside strObject to upper case. So, I use ToUpper() method. But, when I add a breakpoint and go through the line, my string is not getting converted into Upper case. strObject variable will always contain the text Task_status. I wish to convert it into TASK_STATUS. Am I missing anything? Posting my relevant code below:-
public void VerifyValue(String strObject, String strValue, int row)
{
strObject.ToUpper().Trim();
strValue.ToUpper().Trim();
switch (strObject)
{
case "TASK_STATUS":
if (m_taskStatus.taskStatus.ToString() == strValue)
{
ExcelRecorder(null, row);
}
else
{
ExcelRecorder("The value [" + m_taskStatus.taskStatus.ToString() + "] does not match with the given value.", row);
}
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…