LECTURE NOTES OCTOBER 29 2004 ASSIGNMENTS Today 11:58 PM CodeLab #8 Mon 11/8 Assignment 3 Code STRING MANIPULATION, CONT. What? - insert method How? - StringBuffer instance method - first argument: index where insertion begins - second argument: string to insert EXAMPLE Write pieces for a pig latin translator Hello. What street is that? ello-Hay. at-Whay eet-stray is-ay at-thay? - a helper to finds the index of the first vowel in a word - a method to turn a single word into pig latin - a helper to tell whether a character is a letter or not private boolean isLetter(char c) { return ( (c >='A' && c <='Z') || (c >='a' && c <='z') ); } private String pigWord(String word) { int split = firstVowel(word); return word.substring(split)+"-"+word.substring(0, split)+"ay"; } private int firstVowel(String word) { word = word.toLowerCase(); for (int i=0; i