Splits a single character string by pattern
Splits a single character string by pattern. The main difference compared to strsplit
()
is that this method also returns the part of the string that matched
the pattern. Also, it only takes a single character string.
## Default S3 method: splitByPattern(str, pattern, ...)
Henrik Bengtsson
Compare to strsplit
().
rspCode <- "<body>Hello <%=\"world\"%></body>" rspParts <- splitByPattern(rspCode, pattern="<%.*%>") cat(rspCode, "\n") print(rspParts)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.