1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/trans_other.R
\name{stri_trans_char}
\alias{stri_trans_char}
\title{Translate Characters}
\usage{
stri_trans_char(str, pattern, replacement)
}
\arguments{
\item{str}{character vector}
\item{pattern}{a single character string providing code points to be translated}
\item{replacement}{a single character string giving translated code points}
}
\value{
Returns a character vector.
}
\description{
Translates Unicode code points in each input string.
}
\details{
Vectorized over \code{str} and with respect to each code point
in \code{pattern} and \code{replacement}.
If \code{pattern} and \code{replacement} consist of a different number
of code points, then the extra code points in the longer of the two
are ignored, with a warning.
If code points in a given \code{pattern} are not unique, the
last corresponding replacement code point is used.
Time complexity for each string in \code{str} is
O(\code{stri_length(str)*stri_length(pattern)}).
}
\examples{
stri_trans_char('id.123', '.', '_')
stri_trans_char('babaab', 'ab', '01')
stri_trans_char('GCUACGGAGCUUCGGAGCUAG', 'ACGT', 'TGCA')
}
\seealso{
The official online manual of \pkg{stringi} at \url{https://stringi.gagolewski.com/}
Gagolewski M., \pkg{stringi}: Fast and portable character string processing in R, \emph{Journal of Statistical Software} 103(2), 2022, 1-59, \doi{10.18637/jss.v103.i02}
Other transform:
\code{\link{stri_trans_general}()},
\code{\link{stri_trans_list}()},
\code{\link{stri_trans_nfc}()},
\code{\link{stri_trans_tolower}()}
}
\concept{transform}
\author{
\href{https://www.gagolewski.com/}{Marek Gagolewski} and other contributors
}
|