Click here to Skip to main content
15,915,093 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
here is my function
if there is any upper case in a string convert it to lower case

how i have to do

private string RemoveNon_Alphabets_id(string str)
{
StringBuilder sb = new StringBuilder();

for (int i = 0; i < str.Length; i++)
{

if (((char.IsLetter(str[i])) || str[i] == '-'))
{

sb.Append(str[i]);

}

}

return sb.ToString(); ;
}


now the resultant string i want to convert to lower case
where and how to do
Posted
Updated 26-Jul-11 1:24am
v3

C#
return sb.ToString().ToLower(); 
 
Share this answer
 
Comments
kami124 26-Jul-11 7:21am    
OK thanks!
sometime very little problem dosent come to mind
 
Share this answer
 
Hi,
use this

C#
private string RemoveNon_Alphabets_id(string str)
            {
                  StringBuilder sb = new StringBuilder();

                  for (int i = 0; i < str.Length; i++)
                  {

                        if (((char.IsLetter(str[i])) || str[i] == '-'))
                        {

                              sb.Append(str[i]);

                        }

                  }

                  return sb.ToString().ToLower();
            }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900