Free Access Week-  Data Engineering + BI
Data engineering and BI courses are free!
Free AI Access Week from June 2-8

astro (version 1.2)

strip: Strip Leading/Trailing Characters

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

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.

See Also

The astronomy package: astro.

Examples

Run this code
require("astro")

x = "   'lee'   "

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

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

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

Run the code above in your browser using DataLab