In R, using data.table, I was testing if a string contains another string as follows:
library(data.table)
string1 <- "AAAAA"
string2 <- "AAA"
print(string1 %like% string2)
The above returns TRUE. But when string looks like
string1 <- "(A)_"
string2 <- "(A)_"
print(string1 %like% string2)
The above returns FALSE.
Is there any way to fix this other than removing special charaters?