<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: removing a character from a string in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/removing-a-character-from-a-string/m-p/759752#M240157</link>
    <description>&lt;P&gt;We need more information here. What exactly are we looking at? As &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt; said, you can remove things with COMPRESS. This example shows how to only keep (k) alphabetical characters (a) and spaces (s).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
x = 'This "is" a great string';
y = "This 'is' a great string";
run;

data want;
	set have;
		x_no_double = compress(x,,"kas");
		y_no_single = compress(x,,"kas");
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Print: Data Set WORK.WANT" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="r header" scope="col"&gt;Obs&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;x&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;y&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;x_no_double&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;y_no_single&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="l data"&gt;This "is" a great string&lt;/TD&gt;
&lt;TD class="l data"&gt;This 'is' a great string&lt;/TD&gt;
&lt;TD class="l data"&gt;This is a great string&lt;/TD&gt;
&lt;TD class="l data"&gt;This is a great string&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Aug 2021 16:24:16 GMT</pubDate>
    <dc:creator>maguiremq</dc:creator>
    <dc:date>2021-08-05T16:24:16Z</dc:date>
    <item>
      <title>removing a character from a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/removing-a-character-from-a-string/m-p/759742#M240150</link>
      <description>&lt;P&gt;Hello.&amp;nbsp; What is the easiest way to:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;remove the " character from a character variables values?&lt;/LI&gt;
&lt;LI&gt;remove the ' character from a character variables values?&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2021 15:43:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/removing-a-character-from-a-string/m-p/759742#M240150</guid>
      <dc:creator>hein68</dc:creator>
      <dc:date>2021-08-05T15:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: removing a character from a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/removing-a-character-from-a-string/m-p/759743#M240151</link>
      <description>COMPRESS() function to remove specific characters. &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 05 Aug 2021 15:44:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/removing-a-character-from-a-string/m-p/759743#M240151</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-08-05T15:44:32Z</dc:date>
    </item>
    <item>
      <title>Re: removing a character from a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/removing-a-character-from-a-string/m-p/759752#M240157</link>
      <description>&lt;P&gt;We need more information here. What exactly are we looking at? As &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt; said, you can remove things with COMPRESS. This example shows how to only keep (k) alphabetical characters (a) and spaces (s).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
x = 'This "is" a great string';
y = "This 'is' a great string";
run;

data want;
	set have;
		x_no_double = compress(x,,"kas");
		y_no_single = compress(x,,"kas");
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Print: Data Set WORK.WANT" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="r header" scope="col"&gt;Obs&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;x&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;y&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;x_no_double&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;y_no_single&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="l data"&gt;This "is" a great string&lt;/TD&gt;
&lt;TD class="l data"&gt;This 'is' a great string&lt;/TD&gt;
&lt;TD class="l data"&gt;This is a great string&lt;/TD&gt;
&lt;TD class="l data"&gt;This is a great string&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2021 16:24:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/removing-a-character-from-a-string/m-p/759752#M240157</guid>
      <dc:creator>maguiremq</dc:creator>
      <dc:date>2021-08-05T16:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: removing a character from a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/removing-a-character-from-a-string/m-p/759817#M240186</link>
      <description>So you have no other punctuation in your strings?&lt;BR /&gt;&lt;BR /&gt;Try it with this as your input data and ensure it meets your needs.&lt;BR /&gt;&lt;BR /&gt;data have;&lt;BR /&gt;x = 'This, "is" a great string!!';&lt;BR /&gt;y = "This 'is' a great-string!" ;&lt;BR /&gt;run;&lt;BR /&gt;</description>
      <pubDate>Thu, 05 Aug 2021 21:46:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/removing-a-character-from-a-string/m-p/759817#M240186</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-08-05T21:46:17Z</dc:date>
    </item>
  </channel>
</rss>

