Tutorial by Examples

With fixed pattern stri_count_fixed("babab", "b") # [1] 3 stri_count_fixed("babab", "ba") # [1] 2 stri_count_fixed("babab", "bab") # [1] 1 Natively: length(gregexpr("b","babab")[[1]]) # [1] 3 length(gregexpr(...
stri_dup("abc",3) # [1] "abcabcabc" A base R solution that does the same would look like this: paste0(rep("abc",3),collapse = "") # [1] "abcabcabc"
stri_paste(LETTERS,"-", 1:13) # [1] "A-1" "B-2" "C-3" "D-4" "E-5" "F-6" "G-7" "H-8" "I-9" "J-10" "K-11" "L-12" "M-13" # [14] "N-1" "...
Split vector of texts using one pattern: stri_split_fixed(c("To be or not to be.", "This is very short sentence.")," ") # [[1]] # [1] "To" "be" "or" "not" "to" "be." # # [[2]] # [1] "This" ...

Page 1 of 1