Rev 43712 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File src/library/base/man/strtrim.Rd% Part of the R package, http://www.R-project.org% Copyright 1995-2007 R Core Development Team% Distributed under GPL 2 or later\name{strtrim}\alias{strtrim}\title{Trim Character Strings to Specified Widths}\description{Trim character strings to specified display widths.}\usage{strtrim(x, width)}\arguments{\item{x}{a character vector, or an object which can be coerced to acharacter vector by \code{\link{as.character}}.}\item{width}{Positive integer values: recycled to the length of \code{x}.}}\details{\sQuote{Width} is interpreted as the display width in a monospacedfont. What happens with non-printable characters (such as backspace, tab)is implementation-dependent and may depend on the locale (e.g. theymay be included in the count or they may be omitted).Using this function rather than \code{\link{substr}} is important whenthere might be double-width characters in character vectors}\value{A character vector of the same length and with the same attributesas \code{x} (after possible coercion).Elements of the result will be have the encoding declared as that ofthe current locale (see \code{\link{Encoding}} if the correspondinginput had a declared encoding and the current locale is either Latin-1or UTF-8.}\examples{strtrim(c("abcdef", "abcdef", "abcdef"), c(1,5,10))}\keyword{ character }\keyword{ utilities }