From a given string, replace all instances of 'a' with 'one' and 'A' with 'ONE'.
Example Input:
" A boy is playing in a garden"
Example Output:
" ONE boy is playing in one garden"
-- Not that 'A' and 'a' are to be replaced only when they are single characters, not as part of another word.
-- You cannot use "replace" or "replaceAll"
Tuesday, September 29, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment