Strings Tutorial, Complex Filters
These questions use the simple text file http://progzoo.net/greeks.txt - this file includes around three hundred characters from Greek legends.
You may want to review the following: Function composition with String
Andromeda was chained to a rock and left to be eaten by a sea monster. She also has the same letter at the beginning and at the end of her name.
Print those names where the first and last letters are the same (ignoring case).
Penelope waited faithfully for her husband to return from the Trojan wars. She artfully employed embroidery to preserve her chastity.
The first two characters of her name are the same as the last two.
Identify the three characters who include have the same two letters at the end and at the beginning of their names.
The morning star Phosphor has the first three letters "pho" appearing later in the name.
Print the names where the first three characters show up later in the name.
Paris triggered the Trojan war by taking the beautiful Helen from her husband.
His name has an odd number of characters - the middle character is "r".
Print the names with an "r" in the middle.