I am really struggling in this i tried many codes but i failed every time i am not asking to solve my homework but just help me how to start or the way to solve this.
3.1 ShowStringLength(): The method prompts the user to provide a text and the program displays the same text but in capital letters, as well as the number of characters including the spaces in the text.
Requirement: Use a do-while-statement: This part is repeated until the user presses Enter key directly at the prompt without giving any text.
This what i start with but i failed with the Requirement and I am not able to count number of chars.
Console.WriteLine("let me calculate the length of strings for you ");
Console.WriteLine("give me a text of any length, or press enter to exit");
string inputString = Console.ReadLine();
string upperstr1 = inputString.ToUpper();
Console.WriteLine(upperstr1);
private void Calculatenumber()
{
string inputString = Console.ReadLine();
int k = inputString.Length;
}
question from:
https://stackoverflow.com/questions/65922661/how-to-capitalize-all-letters-of-a-string-and-count-all-its-characters-using-a 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…