string s = new string("Hello World").Replace(" ","_").ToLower().ToUpper();
So you basically return from each method the modified object so can you call new methods on it.
string s = new string("Hello World").Replace(" ","_").ToLower().ToUpper();
So you basically return from each method the modified object so can you call new methods on it.
Equivenlant to:
string s = new string("Hello World");
s = s.Replace(" ","_");
s = s.ToLower();
s = s.ToUpper();
The answer is provided by Boldewyn, I am just writing this as a suggestion.
When chaining methods like this, try to write it as follows -
string s = new string("Hello World")
.Replace(" ","_")
.ToLower()
.ToUpper();
This improves code readability.