id/email
password
forgot password | create account
about | help | prefs
ReadingBatcode reading practice

 

 

String OperationsEndsWith

prev  |  next  |  chance

endsWith() returns True if a string ends with a specified substring.

public static boolean endsWith(String s1, String s2) {
    boolean result = s2.endsWith(s1);
    return result;
}
Function Call  Return Value
endsWith("o", "Hello")
endsWith("ll", "Hello")
endsWith("llo", "Hello")
endsWith("5", "525")
endsWith("52", "525")
endsWith("25", "525")
endsWith("g", "Egg")
endsWith("", "World")
endsWith(" ", "Hello World ")
endsWith(" ", "HelloWorld")

Experiment with this code on Gitpod.io

⬅ Back