2

我想将存储为 (STATUS,STATE) 的字符串转换为小写。这是我的代码:

attrVal_TestCondition = Update_Bugs[m].Attributes["TestCondition"].Value;

其中的输出attrVal_TestCondition(STATE,STATUS),我想将其转换为小写。所以我希望我的字符串看起来像这样:

(state,status)

请建议。

4

2 回答 2

1

将字符串转换为小写:

str.ToLower();

在你的情况下:

Update_Bugs[m].Attributes["TestCondition"].Value.ToLower();

或者

Update_Bugs[m].Attributes["TestCondition"].Value.ToString().ToLower();
于 2013-09-16T04:39:34.700 回答
0

如果 No Idea For Name 的答案对您来说不够明显,

attrVal_TestCondition = Update_Bugs[m].Attributes["TestCondition"].Value.ToLowerCase();

字符串以逗号分隔对任何事情都没有影响。您本质上是在询问如何将字符串小写。字符串包含的内容不相关。

于 2013-09-16T04:42:47.720 回答