I have a string
String mainString="///BUY/SELL///ORDERTIME///RT///QTY///BROKERAGE///NETRATE///AMOUNTRS///RATE///SCNM///";
Now I have another strings
String str1= "RT";
which should be matched only with RT
which is substring of string mainString
but not with ORDERTIME
which is also substring of string mainString
.
String str2= "RATE" ;
And RATE
(str2) should be matched with RATE
which is substring of string mainString
but not with NETRATE
which is also substring of string mainString
.
How can we do that ?