code: public static char lastChar(String str) {
  	if (str == null || str.length() == 0) return 0;
  	return str.charAt(str.length() - 1);
      }
docs: return the last character of a string, if string ist empty return 0;
  
  @param str string to get last character
  @return last character