Locked lesson.
About this lesson
We explain the concept of String Indexing to manage and modify elements within a string.
Exercise files
Download this lesson’s related exercise files.
11 - String Indexing.docx60.9 KB 11 - String Indexing SOLUTION.docx
57.8 KB
Quick reference
String Indexing
String indexing allows you to know how many characters are in your string, and allows you to manipulate those characters.
When to use
Use it whenever you want to determine how many characters are in your string.
Instructions
string myName = "John Elder";
myName[0];
myName.Remove(5); // removes everything after the 5th item in myName
myName.Length; // get the length of the string
Hints & tips
- myName[0];
- myName.Remove(5);
- myName.Length;
Lesson notes are only available for subscribers.