middleThree(String str) method added.