Java String startsWith(String prefix) example:
public class Main { public static void main(String[] args) { String bigStr = "Hello World"; String prefix = "Hello W"; System.out.println(bigStr.startsWith(prefix)); } }
true
To specify offset use
startsWith(String prefix, int toffset)