Learn R Programming

gdata (version 2.1.1)

trim: Remove leading and trailing spaces from character strings

Description

Remove leading and traling spaces from character strings

Usage

trim(s)

Arguments

s
character string(s) to be processed

Value

  • Elements of s with all leading and traling spaces removed.

See Also

sub, gsub

Examples

Run this code
s <- "this is an example string    "
trim(s)

Run the code above in your browser using DataLab