<?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 How to replace a substring at first instance in a string in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-replace-a-substring-at-first-instance-in-a-string/m-p/687788#M208845</link>
    <description>&lt;P&gt;Hi Folks,&lt;/P&gt;&lt;P&gt;i have data like beloow&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i want to replace soft in software as hard at first instance only but not in consecutive cases&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input string $100.;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;He is a software and a software programmer&lt;/P&gt;&lt;P&gt;software and a hardware&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;want&lt;/P&gt;&lt;P&gt;He is a&amp;nbsp;&lt;STRONG&gt;hard&lt;/STRONG&gt;ware and software programmer&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;hard&lt;/STRONG&gt;ware and a hardware worker&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 12:25:10 GMT</pubDate>
    <dc:creator>Siva_Harish</dc:creator>
    <dc:date>2020-09-30T12:25:10Z</dc:date>
    <item>
      <title>How to replace a substring at first instance in a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-replace-a-substring-at-first-instance-in-a-string/m-p/687788#M208845</link>
      <description>&lt;P&gt;Hi Folks,&lt;/P&gt;&lt;P&gt;i have data like beloow&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i want to replace soft in software as hard at first instance only but not in consecutive cases&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input string $100.;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;He is a software and a software programmer&lt;/P&gt;&lt;P&gt;software and a hardware&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;want&lt;/P&gt;&lt;P&gt;He is a&amp;nbsp;&lt;STRONG&gt;hard&lt;/STRONG&gt;ware and software programmer&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;hard&lt;/STRONG&gt;ware and a hardware worker&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 12:25:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-replace-a-substring-at-first-instance-in-a-string/m-p/687788#M208845</guid>
      <dc:creator>Siva_Harish</dc:creator>
      <dc:date>2020-09-30T12:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace a substring at first instance in a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-replace-a-substring-at-first-instance-in-a-string/m-p/687790#M208847</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile cards truncover;
input string $100.;

datalines;
He is a software and a software programmer
software and a hardware
;

data want;
 set have;
 substr(string,index(string,'soft'),4)='hard';
run;
proc print noobs;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Sep 2020 12:29:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-replace-a-substring-at-first-instance-in-a-string/m-p/687790#M208847</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-09-30T12:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace a substring at first instance in a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-replace-a-substring-at-first-instance-in-a-string/m-p/687794#M208849</link>
      <description>Thank you!! &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;</description>
      <pubDate>Wed, 30 Sep 2020 12:38:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-replace-a-substring-at-first-instance-in-a-string/m-p/687794#M208849</guid>
      <dc:creator>Siva_Harish</dc:creator>
      <dc:date>2020-09-30T12:38:43Z</dc:date>
    </item>
  </channel>
</rss>

