replace the "a" in a sentence to "the"
Anonymous
this is how i would do it, in pseudocode: create a StringBuffer to add individual characters and eventually return. string to char array iterate through the char array if a character is 't', check the next chars to see if they are 'h' and 'e' respectively. if so, just add 'a' and jump to the proper index in the array if character isn't 't', just add to the StringBuffer return StringBuffer to string or some kind of while using indexOf('the'), but using a StringBuffer instead of lots of String concatenations
Check out your Company Bowl for anonymous work chats.