This section tells you, how to determine the given string ends with specified string. The following program helps you to check whether the given string starts with the specified string is true or false by applying endsWith() method and returns Boolean types values either 'true' or 'false'. If it returns 'true', it will display a message "The given string is end with RoseIndia" otherwise it shows "The given string is not end with RoseIndia".
Description of code:
endsWith(String end):
This is a Boolean type method that returns
either 'true' or 'false'. It checks the given string that end with
specified string in end. It takes string type parameter like:
end: This is the string that is ended.
Here is the code of program:
import java.lang.*;
|
Output of program:
| C:\vinod\Math_package>javac StrEndWith.java C:\vinod\Math_package>java StrEndWith String end with example! Given String : Welcome to RoseIndia End with : RoseIndia The given string is end with RoseIndia |
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: String End with Example
Post your Comment