Hi all :wave:
How to convert first latter to small
is there is any simplest way in C# without using the form loop??
means
if we have string MyConnection
then i want to convert it into myConnection
Thanks
Printable View
Hi all :wave:
How to convert first latter to small
is there is any simplest way in C# without using the form loop??
means
if we have string MyConnection
then i want to convert it into myConnection
Thanks
Try this:
Code:string str = "MyConnection";
if (str.Length > 0)
{
char[] letters = str.ToCharArray();
letters[0] = Char.ToLower(letters[0]); // Change first character to lower case
str = new string(letters);
}
Console.WriteLine(str);
Thanks andy
Another way
Code:string s = "GoodMorningLadiesAndGents";
s = Char.ToLower(s[0]) + s.Substring(1);
Thats nice wayQuote:
Originally Posted by penagate
Thanks :thumb: