public class MyClass {
private static String removeLastChar(String s) {
String result = null;
if ((s != null) && (s.length() > 0)) {
result = s.substring(0, s.length() - 1);
}
return result;
}
public static void main(String args[]) {
String s = "java c c++ python";
s = removeLastChar(s);
System.out.println(s);
}
}
/*
run:
java c c++ pytho
*/