question: public static String replaceIllegalCharacter ( final String text , final char replacement ) { final StringBuilder rVal = new StringBuilder ( ) ; for ( int i = 0 ; i < text . length ( ) ; ++ i ) { if ( ! isIllegalFileNameChar ( text . charAt ( i ) ) ) { rVal . append ( text . charAt ( i ) ) ; } else { rVal . append ( replacement ) ; } } return rVal . toString ( ) ; }
target:  Designed to replace / \b \n \r \t \0 \f ` ? * \ < > | " ' : . , ^ [ ] = + ;