Driver code
public static void main ( String [ ] args ) { String str = " batman " ; char X = ' a ' , Y = ' d ' , Z = ' b ' ; str = replaceRemove ( str . toCharArray ( ) , X , Y , Z ) ; if ( str . length ( ) == 0 ) { System . out . println ( - 1 ) ; } else { System . out . println ( str ) ; } } }