1% Generated by roxygen2 (4.1.1): do not edit by hand
2% Please edit documentation in R/pystr_count.R
3\name{pystr_count}
4\alias{pystr_count}
5\title{Count the occurrences of a substring.}
6\usage{
7pystr_count(str, sub, start = 1, end = max(nchar(str)))
8}
9\arguments{
10\item{str}{A character vector.}
11
12\item{sub}{A character string.}
13
14\item{start}{An integer.}
15
16\item{end}{An integer.}
17}
18\value{
19A numeric vector.
20}
21\description{
22Return the number of non-overlapping occurrences of substring \code{sub} in the range \code{start, end}.
23}
24\examples{
25pystr_count("ababab", "aba")
26pystr_count("abcxyzabc123", "abc")
27pystr_count("a--b--c", "--", 4)
28pystr_count(c("one", "two", "three"), "e")
29}
30\references{
31\url{https://docs.python.org/3/library/stdtypes.html#str.count}
32}
33
34