Consider the string:
a <- "this is a string"
Now, grep
can be used to confirm the presence of substrings:
grep("t",a)
grep("this",a)
But doesn't seem to give the location.
Is there a function that will give me the location of any substring?
getLoction(a, "t")
## 1 12
getLoction(a, "this")
## 1