I have a String java like this :
String query= Select * from table where date between ('2016-05-03' and '2016-05-04' )
I wanted to delete brackets after between i tried :
String search="between";
if(query.toLowerCase().indexOf(search.toLowerCase()) != -1){
query=query.replaceAll("[()]","");
}
It worked but If the query contains some brackets after or before the word 'between' they will be delete also.. Example :
SELECT column-names
FROM table-name1
WHERE value IN (SELECT date
FROM table-name2
WHERE date between ('2016-05-03' and '2016-05-04' ))
I just want to delete two first brackets after the word 'between' to get this :
SELECT column-names
FROM table-name1
WHERE value IN (SELECT date
FROM table-name2
WHERE date between '2016-05-03' and '2016-05-04')
Thanks for your help