Difference between revisions of "Accessing each character of a string"
(Created page with "Accessing the individual characters of a string is a common part of any Section B question. This page looks at the different methods you can use to achieve this. ==Method 1==...") |
(No difference)
|
Revision as of 08:30, 15 June 2023
Accessing the individual characters of a string is a common part of any Section B question. This page looks at the different methods you can use to achieve this.
Method 1
Console.WriteLine("please enter a word:");
string word = Console.ReadLine();
for(int i=0; i < word.Length;i++)
{
Console.WriteLine(word[i]);
}
Console.ReadLine();