public
boolean startsWith(String prefix, int toffset)
Tests
if the substring of this string beginning at the specified index
starts with the specified prefix.
class StringStartsWithOffset{ public static void main(String args[]){ String str = "Self Learning Java"; System.out.println(str.startsWith("Learning", 5)); System.out.println(str.startsWith("Abcd", 5)); } }
Output
true false
No comments:
Post a Comment