我想将存储为 (STATUS,STATE) 的字符串转换为小写。这是我的代码:
attrVal_TestCondition = Update_Bugs[m].Attributes["TestCondition"].Value;
其中的输出attrVal_TestCondition
是(STATE,STATUS)
,我想将其转换为小写。所以我希望我的字符串看起来像这样:
(state,status)
请建议。
将字符串转换为小写:
str.ToLower();
在你的情况下:
Update_Bugs[m].Attributes["TestCondition"].Value.ToLower();
或者
Update_Bugs[m].Attributes["TestCondition"].Value.ToString().ToLower();
如果 No Idea For Name 的答案对您来说不够明显,
attrVal_TestCondition = Update_Bugs[m].Attributes["TestCondition"].Value.ToLowerCase();
字符串以逗号分隔对任何事情都没有影响。您本质上是在询问如何将字符串小写。字符串包含的内容不相关。