Write a Java program to check if a string starts with a specified word
Sample Data: string1 = "Hello how are you?"Sample Output:
true
import java.util.*; import java.io.*; public class Exercise85 { public static void main(String[] args) { String string1 = "Hello how are you?"; System.out.println(string1.startsWith("Hello")); } }
Sample Output:
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer