Date: Wed, 25 Aug 2010 08:04:05 -0400
Reply-To: Arthur Tabachneck <art297@NETSCAPE.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Arthur Tabachneck <art297@NETSCAPE.NET>
Subject: Re: Removing Blanks before and after a symbol
Tyler,
Glad to see that you solved it on your own but, unless I'm mistaken, you
only needed the first two lines. e.g.:
data want;
set have;
String=tranwrd(tranwrd(String,"# ","#")," #","#");
run;
HTH,
Art
--------
On Wed, 25 Aug 2010 07:55:58 -0400, Tyler Lonczak <lonczakt@GMAIL.COM>
wrote:
>Got it:
>String = Tranwrd(String,'# ','#');
>String = Tranwrd(String,' #','#');
>String = Tranwrd(String,' # ','#');
>
>
>On Wed, Aug 25, 2010 at 7:38 AM, Tyler Lonczak <lonczakt@gmail.com> wrote:
>> Hi,
>>
>> I'm hopeful someone may be able to help me with this.
>>
>> What I've got: " # This is # A string# with symbols # in it"
>>
>> What I need: "#This is#A string#with symbols#in it"
>>
>> Basically I need to remove the blank spaces to the left and right of
>> the # symbol. Sometimes there will be a space to the left(right) of
>> the symbol and sometimes not.
>>
>> Please help.
>>
>> Thanks,
>> Tyler
>>
|