The startsWith(String prefix) method is utilized to check if the stated string starts with the prefix or not that is being specified by us.
Method Definition: Boolean startsWith(String prefix)
Return Type: It returns true if the string starts with the specified prefix else it returns false.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.