ex:
if we have a string s1="abcde" s2="abd"
find the occurrences of "ad" in s1,s2.. here the occurrence count is 2 on the whole..
Can any1 help me regarding the regex code in java... pls..
ex:
if we have a string s1="abcde" s2="abd"
find the occurrences of "ad" in s1,s2.. here the occurrence count is 2 on the whole..
Can any1 help me regarding the regex code in java... pls..
You could use indexOf(String str)
and then indexOf(String str, int fromIndex)
to find all the occurrences and their position.