question: public static String replaceChars ( String str , String oldchars , char newchar ) { int pos = indexOfChars ( str , oldchars ) ; if ( pos == - 1 ) { return str ; } StringBuilder buf = new StringBuilder ( str ) ; do { buf . setCharAt ( pos , newchar ) ; pos = indexOfChars ( str , oldchars , pos + 1 ) ; } while ( pos != - 1 ) ; return buf . toString ( ) ; }
target:  Like String.replace() except that it accepts any number of old chars. Replaces any occurrances of 'oldchars' in 'str' with 'newchar'. Example: replaceChars("Hello, world!", "H,!", ' ') returns " ello  world "