In this section, you will learn how to check the given string that start from the specified character in java. The following program checks the started string with "Wel". If you use startsWith() function it will return 'true' and display a message "The given string is start with Wel" otherwise it will show "The given string is not start with Wel".
Description of code:
This is a Boolean type method that returns either 'true' or 'false'. It checks the given string that begins with specified string in the beginning. It takes a string type parameter such as:
start: This is the string that starts.
Here is the code of program:
Output of program:
String start with example!
Given String : Welcome to RoseIndia
Start with : Wel
The given string is start with Wel
Liked it! Share this Tutorial