String a = "Programme"; System.out.println(a.substring(0,4).equals("pro"));
Answers
Answered by
1
Answer:
String a = "Programme";
System.out.println(a.substring(0,3).equals("Pro"));
Explanation:
You were getting 'false' as an output as the indexing was wrong as it checks the string from '1' index and also the method is case sensitive so it was checking for 'pro' while the string was "Programme' with a capital P
Similar questions