private String stringReplace ( final String source , final String find , final String replace ) { if ( source == null || find == null || replace == null ) return source ; final int index = source . indexOf ( find ) ; if ( index == - 1 ) return source ; // no occurence, don't do anything; if ( index == 0 ) return replace + source . substring ( find . length ( ) ) ; return source . substring ( 0 , index ) + replace + source . substring ( index + find . length ( ) ) ; }
Replaces a first occurence of a String with another string