<?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 count trailing spaces in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/count-trailing-spaces/m-p/763188#M241690</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.ds;
	length string $20;
 
	string = '12345';
	count_spaces = countc(string,,'st') /*space count*/;
	output;
 
	string = 'A B';
	count_spaces = countc(string,,'st') /*count space between two char*/;
	output;
 
	string = '1 2 3';
	count_spaces = countc(string,,'st') ;/*count spaces between characters*/;
	output;
 
	string = ' a';
	count_spaces = countc(string,,'st')   /*count leading spaces*/;
	output;
	string='a   ';
	count_spaces=countc(string,right,'') /* count trailing spaces */;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;How to count trailing spaces&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 23 Aug 2021 08:44:15 GMT</pubDate>
    <dc:creator>BrahmanandaRao</dc:creator>
    <dc:date>2021-08-23T08:44:15Z</dc:date>
    <item>
      <title>count trailing spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/count-trailing-spaces/m-p/763188#M241690</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.ds;
	length string $20;
 
	string = '12345';
	count_spaces = countc(string,,'st') /*space count*/;
	output;
 
	string = 'A B';
	count_spaces = countc(string,,'st') /*count space between two char*/;
	output;
 
	string = '1 2 3';
	count_spaces = countc(string,,'st') ;/*count spaces between characters*/;
	output;
 
	string = ' a';
	count_spaces = countc(string,,'st')   /*count leading spaces*/;
	output;
	string='a   ';
	count_spaces=countc(string,right,'') /* count trailing spaces */;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;How to count trailing spaces&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 08:44:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/count-trailing-spaces/m-p/763188#M241690</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2021-08-23T08:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: count trailing spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/count-trailing-spaces/m-p/763194#M241692</link>
      <description>&lt;P&gt;Unsure what you're trying to achieve, but this works:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;COUNT_TRAILING_SPACES=vlength(STRING)-lengthn(STRING);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 09:58:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/count-trailing-spaces/m-p/763194#M241692</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-08-23T09:58:54Z</dc:date>
    </item>
  </channel>
</rss>

