strip: Strip Leading/Trailing Characters

Description Usage Arguments Details Author(s) See Also Examples

View source: R/strip.R

Description

Strips leading/trailing characters from the input string. Particularly useful for extracting information from FITS file headers which are embedded in a complex string, for example.

Usage

1
strip(x, strip = " ")

Arguments

x

input string

strip

character to be stripped (may be a vector)

Details

Characters in the string will be stripped 'outside in', from left-to-right in the order they are given in the argument. See examples below for more detail.

Author(s)

Lee Kelvin <lee.kelvin@uibk.ac.at>

See Also

The astronomy package: astro.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
require("astro")

x = "   'lee'   "

strip(x, strip=" ")
#[1] "'lee'"

strip(x, strip=c(" ","'"))
#[1] "lee"

strip(x, strip=c("'"," "))
#[1] "'lee'"

astro documentation built on May 2, 2019, 2:14 a.m.

Related to strip in astro...