| Line 9... |
Line 9... |
| 9 |
\alias{substr<-}
|
9 |
\alias{substr<-}
|
| 10 |
\alias{substring<-}
|
10 |
\alias{substring<-}
|
| 11 |
\title{Substrings of a Character Vector}
|
11 |
\title{Substrings of a Character Vector}
|
| 12 |
\usage{
|
12 |
\usage{
|
| 13 |
substr(x, start, stop)
|
13 |
substr(x, start, stop)
|
| 14 |
substring(text, first, last = 1000000L)
|
14 |
substring(text, first, last = NULL)
|
| 15 |
|
15 |
|
| 16 |
substr(x, start, stop) <- value
|
16 |
substr(x, start, stop) <- value
|
| 17 |
substring(text, first, last = 1000000L) <- value
|
17 |
substring(text, first, last = NULL) <- value
|
| 18 |
}
|
18 |
}
|
| 19 |
\arguments{
|
19 |
\arguments{
|
| 20 |
\item{x, text}{a character vector.}
|
20 |
\item{x, text}{a character vector.}
|
| 21 |
\item{start, first}{integer. The first character to be extracted or replaced.}
|
21 |
\item{start, first}{integer. The first character to be extracted or replaced.}
|
| 22 |
\item{stop, last}{integer. The last character to be extracted or replaced.}
|
22 |
\item{stop, last}{integer or NULL. The last character to be extracted or replaced.}
|
| 23 |
\item{value}{a character vector, recycled if necessary.}
|
23 |
\item{value}{a character vector, recycled if necessary.}
|
| 24 |
}
|
24 |
}
|
| 25 |
\description{
|
25 |
\description{
|
| 26 |
Extract or replace substrings in a character vector.
|
26 |
Extract or replace substrings in a character vector.
|
| 27 |
}
|
27 |
}
|
| Line 33... |
Line 33... |
| 33 |
|
33 |
|
| 34 |
When extracting, if \code{start} is larger than the string length then
|
34 |
When extracting, if \code{start} is larger than the string length then
|
| 35 |
\code{""} is returned. If \code{stop} is larger than the string length
|
35 |
\code{""} is returned. If \code{stop} is larger than the string length
|
| 36 |
then the portion until the end of the string is returned.
|
36 |
then the portion until the end of the string is returned.
|
| 37 |
|
37 |
|
| - |
|
38 |
If \code{stop} is \code{NULL}, \code{substr} will return substrings of
|
| - |
|
39 |
\code{x} from \code{start} to the end of each string in \code{x}.
|
| - |
|
40 |
|
| 38 |
For the extraction functions, \code{x} or \code{text} will be
|
41 |
For the extraction functions, \code{x} or \code{text} will be
|
| 39 |
converted to a character vector by \code{\link{as.character}} if it is not
|
42 |
converted to a character vector by \code{\link{as.character}} if it is not
|
| 40 |
already one.
|
43 |
already one.
|
| 41 |
|
44 |
|
| 42 |
For the replacement functions, if \code{start} is larger than the
|
45 |
For the replacement functions, if \code{start} is larger than the
|