I am trying to find the occurrence of hyphen - in a string "TC 1 - TC 24". For that I used
"TC 1 - TC 24".contains(" \\-")
But the above expression doesn't returns true. What am I doing wrong?
The code looks like:
if("TC 1 - TC 24".contains(" \\- ") == true) {
//print something
}