public static String last ( String string , char separator ) { if ( string == null ) { return null ; } if ( string . isEmpty ( ) ) { return "" ; } return string . substring ( string . lastIndexOf ( separator ) + 1 ) ; }
Get last string sequence following given character . If separator character is missing from the source string returns entire string . Return null if string argument is null and empty if empty .