.NET In-Browser Tutorial

This page doesn't work on Internet Explorer. We recommend you try the new Microsoft Edge browser.

Step 5: Methods

Methods take inputs, do some work, and sometimes return a result.

ToUpper() is a method you can invoke on a string, like the name variable. It will return the same string, converted to uppercase.

Update the greeting to change the name of the person being greeted to uppercase and select Run code.

                    var name = "<name>";
Console.WriteLine($"Hello {name.ToUpper()}!");
                    Show me
                
                    var name = "<name>";
Console.WriteLine($"Hello {name.ToUpper()}!");
                
Press Alt+F1 for accessibility options.
                Console.WriteLine("Hello World!");
            

Ready to get started?

Learn .NET easily with our step-by-step tutorials.

Get started