user2778482
user2778482

Reputation: 59

How can i convert comma separated strings to lower case using c#

I would like to convert the string stored as (STATUS,STATE) to lower case. Here is my code :

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

where output for attrVal_TestCondition is (STATE,STATUS) and i would like to convert this to lower case. So i want my string to look like this :

(state,status)

Please suggest.

Upvotes: 2

Views: 1195

Answers (2)

No Idea For Name
No Idea For Name

Reputation: 11577

to convert string to lower case do:

str.ToLower();

and in your case:

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

or

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

Upvotes: 1

user833345
user833345

Reputation: 1

In case No Idea For Name's answer is not blindingly obvious enough for you,

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

That the string is comma separated has no bearing on anything. You are essentially asking how to lower case a string. What the string contains is not relevant.

Upvotes: 0

Related Questions