I have a String replacedtext
which is:
Replaced text:OPTIONS (ERRORS=5000)
LOAD DATA
INFILE *
APPEND INTO TABLE REPO.test
Fields terminated by "," optionally enclosed BY '"'
trailing nullcols
(
CODE ,
user,
date DATE "MM/DD/YYYY"
)
I want to count the Number of REPO. in this whole string.So,I tried in this way but it is not working.
String[] words = replacedtext.split("\\s+");
int count=0;
for(String w:words){
if(w.equals("\\bREPO.\\b")){
count++;
}
}
System.out.println ("count is :"+count);
Output coming is:
count is :0
Since in the string REPO.
is seen for once. My output needs to be count is:1
.