I have a string:
20160719_P_BID_20160718_130000
I need to check if this string contains the substring "BID". I have tried various methods like:
.contains("BID") / .contains("_BID_").indexOf("BID").substring(11,14).equals("BID)
but all methods have returned false even though the output of the strings does contain the string "BID" and is the string "BID"
Update:
String fileName = file.getFileName();
String tradeTypeStr = fileName.substring(11,14);
if(tradeTypeStr.equalsIgnoreCase(tradeType))
Can someone shed some light as to why the methods are returning false?
Thanks for your help!
"20160719_P_BID_20160718_130000".contains("BID")and the result is "true"fileName