File: clipString.Rd

package info (click to toggle)
r-cran-bbmisc 1.13.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,256 kB
  • sloc: ansic: 176; sh: 9; makefile: 5
file content (30 lines) | stat: -rw-r--r-- 804 bytes parent folder | download
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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/clipString.R
\name{clipString}
\alias{clipString}
\title{Shortens strings to a given length}
\usage{
clipString(x, len, tail = "...")
}
\arguments{
\item{x}{[\code{character}]\cr
Vector of strings.}

\item{len}{[\code{integer(1)}]\cr
Absolute length the string should be clipped to, including \code{tail}.
Note that you cannot clip to a shorter length than \code{tail}.}

\item{tail}{[\code{character(1)}]\cr
If the string has to be shortened at least 1 character, the final characters will be \code{tail}.
Default is \dQuote{...}.}
}
\value{
[\code{character(1)}].
}
\description{
Clips strings to a maximum length, appending a tail if shortened.
}
\examples{
print(clipString("abcdef", 10))
print(clipString("abcdef", 5))
}