I have a funtion in my program that should determine if the last char of a string is a / and if not, add a / at the end, however, it always adds a /, even if the last char is a / Here is the code:
public static String setLastCharSlash(String check) {
if(check.substring(check.length() - 1) != "/") {
check = check + "/";
}
return check;
}