<?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: Replacing specific characters of a string in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/replacing-specific-characters-of-a-string/m-p/12319112#M159298</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8021187"&gt;@Daan_M&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You should assign a variable in my case its newString, but you can assign oVar1 as newString&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;oVar1&lt;/SPAN&gt; = &lt;SPAN&gt;"EUA_xxx_A"&lt;/SPAN&gt;
&lt;SPAN&gt;oVarSize&lt;/SPAN&gt; = &lt;SPAN&gt;"025"&lt;/SPAN&gt;

&lt;SPAN&gt;newString&lt;/SPAN&gt; = &lt;SPAN&gt;Replace&lt;/SPAN&gt;(&lt;SPAN&gt;oVar1&lt;/SPAN&gt;, &lt;SPAN&gt;"xxx"&lt;/SPAN&gt;, &lt;SPAN&gt;oVarSize&lt;/SPAN&gt;)

&lt;SPAN&gt;Logger&lt;/SPAN&gt;.&lt;SPAN&gt;Info&lt;/SPAN&gt;(&lt;SPAN&gt;newString&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 20 Oct 2023 09:37:35 GMT</pubDate>
    <dc:creator>m_baczewski</dc:creator>
    <dc:date>2023-10-20T09:37:35Z</dc:date>
    <item>
      <title>Replacing specific characters of a string</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/replacing-specific-characters-of-a-string/m-p/12319028#M159295</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a string variable in format: [Name]_xxx_[Something else]&lt;/P&gt;&lt;P&gt;And another string variable called size : "999"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to replace the "xxx" with the size variable, but i can't get it to work.&lt;/P&gt;&lt;P&gt;I tried the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;Dim oVar2 As String = GoExcel.CellValue(oExcel, "Blad1", "D" &amp;amp; oSubCellCount) 

'Gives output: "EUA_xxx_A"

Dim oVarSize As String 	= GoExcel.CellValue(oExcel, "Blad1", "B" &amp;amp; oCellCount) 

'Gives output: "025"

Replace(oVar2, "xxx", oVarSize)

Msgbox(oVar2)

'Still gives output "EUA_xxx_A" and not the desired "EUA_025_A"
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i also tried without succes:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;oVar2.replace("xxx", oVarSize)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The solution is probabably pretty simple, but an explanation of what i do wrong is appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2023 09:01:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/replacing-specific-characters-of-a-string/m-p/12319028#M159295</guid>
      <dc:creator>Daan_M</dc:creator>
      <dc:date>2023-10-20T09:01:31Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing specific characters of a string</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/replacing-specific-characters-of-a-string/m-p/12319100#M159297</link>
      <description>&lt;P&gt;Found it, i needed to assign the change to the string variable itself:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;oVar2 = replace(oVar2, "xxx", oVarSize)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 20 Oct 2023 09:31:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/replacing-specific-characters-of-a-string/m-p/12319100#M159297</guid>
      <dc:creator>Daan_M</dc:creator>
      <dc:date>2023-10-20T09:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing specific characters of a string</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/replacing-specific-characters-of-a-string/m-p/12319112#M159298</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8021187"&gt;@Daan_M&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You should assign a variable in my case its newString, but you can assign oVar1 as newString&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;oVar1&lt;/SPAN&gt; = &lt;SPAN&gt;"EUA_xxx_A"&lt;/SPAN&gt;
&lt;SPAN&gt;oVarSize&lt;/SPAN&gt; = &lt;SPAN&gt;"025"&lt;/SPAN&gt;

&lt;SPAN&gt;newString&lt;/SPAN&gt; = &lt;SPAN&gt;Replace&lt;/SPAN&gt;(&lt;SPAN&gt;oVar1&lt;/SPAN&gt;, &lt;SPAN&gt;"xxx"&lt;/SPAN&gt;, &lt;SPAN&gt;oVarSize&lt;/SPAN&gt;)

&lt;SPAN&gt;Logger&lt;/SPAN&gt;.&lt;SPAN&gt;Info&lt;/SPAN&gt;(&lt;SPAN&gt;newString&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2023 09:37:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/replacing-specific-characters-of-a-string/m-p/12319112#M159298</guid>
      <dc:creator>m_baczewski</dc:creator>
      <dc:date>2023-10-20T09:37:35Z</dc:date>
    </item>
  </channel>
</rss>

