public MessageBuilder replaceFirst ( String target , String replacement ) { int index = builder . indexOf ( target ) ; if ( index != - 1 ) { builder . replace ( index , index + target . length ( ) , replacement ) ; } return this ; }
Replaces the first substring that matches the target string with the specified replacement string .