Learn R Programming

gtx (version 0.0.8)

sanitise.whitespace: Remove leading and trailing spaces; convert double spaces to single spaces.

Description

Convenience function for a series of gsub() calls.

Usage

sanitise.whitespace(tt)

Arguments

tt
a character vector.

Value

A character vector with leading and trailing spaces removed, and double spaces converted to single spaces.

Examples

Run this code
sanitise.whitespace(c("  A to G", "A to  G", "A to G", "A   to G   "))

Run the code above in your browser using DataLab