Example #1
0
 // Returns true if the letter string starts with the letter.
 public bool StartsWith(Letter letter)
 {
     if (letters.Count >= 1)
         return letters[0] == letter;
     return false;
 }
Example #2
0
 // Inserts a letter into the letter string.
 public void Insert(int index, Letter letter)
 {
     letters.Insert(index, letter);
 }
Example #3
0
 // Adds a letter to the letter string.
 public void Add(Letter letter)
 {
     letters.Add(letter);
 }
Example #4
0
 // Returns true if the letter string ends with the letter.
 public bool EndsWith(Letter letter)
 {
     if (letters.Count >= 1)
         return letters[letters.Count - 1] == letter;
     return false;
 }
Example #5
0
 // Constructs a copy of the letter string.
 public LetterString(Letter letter)
 {
     this.letters = new List<Letter>();
     this.letters.Add(letter);
 }