How do I get a substring from a string with an unknown length?

I'm writing a program that has different outputs depending on a name inputted by the user. The format of the output is decided by the first letter with the rest of the name being used throughout excluding the first letter. Essentially how do I make a substring so it follows something like this?

 Console.WriteLine("What name would you like to use?(please enter in lower case)"); name = Console.ReadLine(); namelength = name.Length; letter = name.Substring(0); restofname = name.Substring(1, namelength); 

by Operationroobaloo via /r/csharp

Leave a Reply