https://github.com/cran/pracma
Revision 7ba95550c2066826c77bc78b974b7cb8cd416301 authored by Hans W. Borchers on 11 January 2017, 00:43:13 UTC, committed by cran-robot on 11 January 2017, 00:43:13 UTC
1 parent 00dcc24
Raw File
Tip revision: 7ba95550c2066826c77bc78b974b7cb8cd416301 authored by Hans W. Borchers on 11 January 2017, 00:43:13 UTC
version 1.9.9
Tip revision: 7ba9555
strfind.R
##
##  s t r f i n d . R  Test suite
##


strfind <- pracma::strfind
strfindi <- pracma::strfindi
#findstr <- pracma::findstr

identical(strfind("", "aba"), NULL)
identical(strfind("ab", "aba"), NULL)
identical(strfind("aba", "aba"), 1)
identical(strfind("ababa", "aba"), c(1, 3))
identical(strfind("ababa", "aba", overlap=FALSE), 1)

identical(strfindi("ABA", "aba"), 1)
identical(strfindi("aba", "ABA"), 1)
identical(strfindi("ABABA", "aba"), c(1, 3))
identical(strfindi("aBaBa", "AbA", overlap=FALSE), 1)
back to top