ToUpper () string with ToString () function

I used a string in C #, where I use C # in Visual studio 2008. I wanted to convert it to uppercase.

string lowerString = txtCheck.Text;
string upperString = lowerString.ToUpper();

This was usually the way I should use it, but the fact is that I didn’t get any errors when I used it like that

string upperString = lowerString.ToUpper().Tostring();

Now I am confused that ToUpper () is also a function, whereas I can use the second syntax when I use ToUpper () again . Tostring (); , I mean that it will mean Function1 (). Function2 () .

+4
source share
3 answers

, ToString , ToUpper. , . :

lowerString.ToUpper.ToString();

, (ToString) .

+9

ToUpper() - , , :

string upperString = txtCheck.Text.ToUpper();

ToString().

+5

:

string upperString = (lowerString   .ToUpper())   .ToString();

, lowerString.ToUpper() lowerString.ToUpper() ToString(). , , .

, :

upperString = toString (toUpper (lowerString));

, :

string upper = lower.ToUpper().ToLower().ToUpper().ToString().ToString();

:-)

+3

Source: https://habr.com/ru/post/1764089/


All Articles