I have a trouble using substring function here. Below, i used remove function. But i wanna (want to) use substring function. Can you give me a hint?
- Enter a phrase: ABCDEFGH
Output:
GH
EFGH
CDEFGH
ABCDEFGH
CodePudding user response:
I wrote a central part for you, you will have to write an user interface and user input validation
var phrase = "ABCDEFGH";
int i;
for (i=phrase.Length-2; i >=0; i-=2) Console.WriteLine(phrase.Substring(i));
if (i == -1) Console.WriteLine(phrase);