public static String removePrefix ( String value , String prefix ) { if ( value == null || prefix == null || prefix . length ( ) > value . length ( ) ) { return value ; } return value . startsWith ( prefix ) ? value . substring ( prefix . length ( ) ) : value ; }
Remove string prefix if and only if string value starts with the prefix otherwise original string is returned .