LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (November 2000, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 1 Nov 2000 10:59:15 -0800
Reply-To:     "Lund, Pete" <Peter.Lund@CFC.WA.GOV>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Lund, Pete" <Peter.Lund@CFC.WA.GOV>
Subject:      Re: remove extra space in character string
Comments: To: "Xu, Meifen" <mxu@AMGEN.COM>
Content-Type: text/plain; charset="iso-8859-1"

Meifen- You can use the COMPBL() function. This function compresses multiple, consecutive blanks in a string to a single blank - just what you're looking for.

----------------------------------------------------------- Pete Lund WA State Caseload Forecast Council 515 15th Ave SE Olympia, WA 98504-0962 (360) 902-0086 voice (360) 902-0084 fax (360) 971-0962 pager peter.lund@cfc.wa.gov ----------------------------------------------------------------------

-----Original Message----- From: Xu, Meifen [mailto:mxu@AMGEN.COM] Sent: Wednesday, November 01, 2000 10:54 AM To: SAS-L@LISTSERV.UGA.EDU Subject: remove extra space in character string

Hello, there:

I have a character variable with most character string looking very regular. But there are a few strings among the words having more than one space. I certainly want to eliminate these extra space and tried translate(var, ' ', ' '). It turned to me it does not work out. I don't think compress can function at this case because between words one space needed for sure.

Here is the string that I want to deal with:

My leg was injured. this is original one.

I like it looking like:

My leg was injured.

Thanks


Back to: Top of message | Previous page | Main SAS-L page