s-news
[Top] [All Lists]

Re: Trimming character strings

To: S-News <s-news@lists.biostat.wustl.edu>
Subject: Re: Trimming character strings
From: Thom Burnett <Thom.Burnett@cognigencorp.com>
Date: Thu, 27 Jan 2005 15:29:15 -0500
In-reply-to: <41F94C59.40308@bms.com>
References: <41F94148.5000506@cognigencorp.com> <41F94C59.40308@bms.com>
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113
Scott,

strip.blanks() is in 6.2 SPlus.
It seems to be in a different sort of help file - not under the standard help. but I did find it. I don't understand why there are functions that aren't part of the normal documentation. How does one find out about them?

Thanks to all the others who wrote functions for doing this.

Thom

Scott D Chasalow wrote:

You can use strip.blanks to remove leading and trailing blanks. Will not, however, remove tabs. May be undocumented.

Cheers,
Scott

Thom Burnett wrote:

This should be quick and easy for someone.

How do I remove leading and trailing white space from a string?

nameWithSpaces <- "  John Doe  "
onlyName <- whatFunction(nameWithSpaces)
onlyName
"John Doe"

I thought I saw a function for this some month or so ago but now I can't find anything short of using substring one character at a time.

Thanx for any help.

Thom

--------------------------------------------------------------------
This message was distributed by s-news@lists.biostat.wustl.edu.  To
unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
the BODY of the message:  unsubscribe s-news



<Prev in Thread] Current Thread [Next in Thread>