✅ 'startsWith()' in Java | Java
\nif(you like)\n\tplease upvote;\n\n\n\n# Java Code\n\nclass Solution {\n    public int countPrefixes(String[] words, String s) {\n        int cnt = 0;\n       
```\nif(you like)\n\tplease upvote;\n```\n![image.png](https://assets.leetcode.com/users/images/c46bfd5c-cd60-4a0f-a3af-d56e67ae236a_1664727810.0896583.png)\n\n# Java Code\n```\nclass Solution {\n    public int countPrefixes(String[] words, String s) {\n        int cnt = 0;\n        for(String str:words)        \n        {\n            if(s.startsWith(str) == true)\n                cnt++;\n        }\n        return cnt;\n    }\n}\n```
['String', 'Java']