12
Dec
Method: String.startsWith();
It will return the boolean value.
public class Main {
public static void main(String[] args) {
String sentence="Hello Java";
System.out.println(sentence.startsWith("Hello"));
}
}
Output:
true
Leave a Reply