String methods – startsWith and endsWith

In this post, we will discuss 2 methods which are endsWith() and startsWith(). Let’s understand with examples. boolean endsWith(String suffix): This method checks if string ends with specified suffix. If ends with specified  suffix then returns...