private String alterPrefix ( String word , String oldPrefix , String newPrefix ) { if ( word . startsWith ( oldPrefix ) ) { return word . replaceFirst ( oldPrefix , newPrefix ) ; } return ( newPrefix + word ) ; }
Manipulates a string by cutting of a prefix if present and adding a new prefix .