trim.String: Removes white space from both ends of this string

Description Usage Value Author(s) Examples

Description

Removes white space from both ends of this string. The following character values are all white spaces: "\t" (0x09 - HORIZONTAL TABULATION), "\n" (0x0A - NEW LINE), "\v" (0x0B - VERTICAL SPACE), "\f" (0x0C - FORM FEED), "\r" (0x0D - CARRIAGE RETURN), and " " (0x20 - SPACE).

Usage

1
2
## S3 method for class 'String'
trim(this, ...)

Value

Returns this string, with white space removed from the front and end.

Author(s)

Henrik Bengtsson (http://www.braju.com/R/)

Examples

1
2
3
  s <- String("\t  Hello world!\n")
  print(trim(s))                           # "Hello world!"
  print(trim("\t  Hello world!\n"))        # "Hello world!"

HenrikBengtsson/R.lang documentation built on May 8, 2019, 7:50 p.m.