Write a function to scroll the line. For instance:
void loopThroughString(string loopString) { foreach (char c in loopString) { Console.WriteLine(c); } }
Now you can call this function:
loopThroughString("Hello c#");
EDIT
Of, if you like linq, you can turn a string into a list of one-character strings and concatenate it by adding new lines between each character rather than printing to the console
string myString = "Hello c#"; List<string> characterList = myString.Select(c => c.ToString()).ToList(); Console.WriteLine(string.Join("\n", characterList));
source share