<?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: Splitting or matching a string in a service in ThingWorx Developers</title>
    <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Splitting-or-matching-a-string-in-a-service/m-p/652141#M43227</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use substring:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;var str = "This contains a string.";
var cut = str.substring(2,11); // cut = "is contai"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Mar 2020 10:50:18 GMT</pubDate>
    <dc:creator>Radu</dc:creator>
    <dc:date>2020-03-03T10:50:18Z</dc:date>
    <item>
      <title>Splitting or matching a string in a service</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Splitting-or-matching-a-string-in-a-service/m-p/652131#M43225</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I want to take a part of input string and compare it with an existing string and store it. There are functions like split, splice , includes, etc in JS but I am unable to use them. How can I achieve the functionality?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 09:46:06 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Splitting-or-matching-a-string-in-a-service/m-p/652131#M43225</guid>
      <dc:creator>gourinaik98</dc:creator>
      <dc:date>2020-03-03T09:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting or matching a string in a service</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Splitting-or-matching-a-string-in-a-service/m-p/652141#M43227</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use substring:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;var str = "This contains a string.";
var cut = str.substring(2,11); // cut = "is contai"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 10:50:18 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Splitting-or-matching-a-string-in-a-service/m-p/652141#M43227</guid>
      <dc:creator>Radu</dc:creator>
      <dc:date>2020-03-03T10:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting or matching a string in a service</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Splitting-or-matching-a-string-in-a-service/m-p/652314#M43258</link>
      <description>&lt;P&gt;Just checked it, can you tell me why it isn't working in the infotable for loop? outside the loop it works fine! The thing is, I am comparing the string with another string which is in the infotable&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 05:03:51 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Splitting-or-matching-a-string-in-a-service/m-p/652314#M43258</guid>
      <dc:creator>gourinaik98</dc:creator>
      <dc:date>2020-03-04T05:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting or matching a string in a service</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Splitting-or-matching-a-string-in-a-service/m-p/652341#M43263</link>
      <description>&lt;P&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/310934"&gt;@gourinaik98&lt;/a&gt;, can you show an example of your code where it doesn't work?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 07:49:00 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Splitting-or-matching-a-string-in-a-service/m-p/652341#M43263</guid>
      <dc:creator>Constantine</dc:creator>
      <dc:date>2020-03-04T07:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting or matching a string in a service</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Splitting-or-matching-a-string-in-a-service/m-p/652353#M43269</link>
      <description>&lt;P&gt;hi, I was able to solve my problem without using the functions as I am using mssql db. I have another problem now. I am fetching some strings from db and displaying it in a list dropdown. I select one and submit. When i submit, the selected item must be deleted from the list and updated list must be shown. Can u help me in this? This is my code:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;var res = Things["mes_db"].GetOrderNum({&lt;BR /&gt;prodPartNum: prodPartNum /* STRING */&lt;BR /&gt;});&lt;/P&gt;
&lt;P&gt;var params = {&lt;BR /&gt;infoTableName : "InfoTable",&lt;BR /&gt;dataShapeName : "OrderNumber"&lt;BR /&gt;};&lt;/P&gt;
&lt;P&gt;var result = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);&lt;BR /&gt;result=res;&lt;/P&gt;
&lt;P&gt;var tableLength = result.rows.length;&lt;BR /&gt;for (var x=0; x &amp;lt; tableLength; x++) {&lt;BR /&gt;var row = result.rows[x];&lt;BR /&gt;if(row.order_num.trim()==selectedOrderNum.trim())&lt;BR /&gt;result.RemoveRow(x);&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 08:38:41 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Splitting-or-matching-a-string-in-a-service/m-p/652353#M43269</guid>
      <dc:creator>gourinaik98</dc:creator>
      <dc:date>2020-03-04T08:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting or matching a string in a service</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Splitting-or-matching-a-string-in-a-service/m-p/652363#M43276</link>
      <description>&lt;P&gt;A typical approach is to delete the selected row in the database and re-run the query after that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you only need to delete a row in an infotable, then you can replace your code with those two lines (make sure all your strings are timmed &lt;EM&gt;before&lt;/EM&gt; doing it):&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;var result = Things["mes_db"].GetOrderNum({ prodPartNum: prodPartNum });
result.Delete({ order_num: selectedOrderNum });&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/ Constantine&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 09:05:24 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Splitting-or-matching-a-string-in-a-service/m-p/652363#M43276</guid>
      <dc:creator>Constantine</dc:creator>
      <dc:date>2020-03-04T09:05:24Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting or matching a string in a service</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Splitting-or-matching-a-string-in-a-service/m-p/652366#M43277</link>
      <description>&lt;P&gt;Thank you! One more thing, the selectedOrderNum must be bound to the selectedRows of the same service right?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 09:14:38 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Splitting-or-matching-a-string-in-a-service/m-p/652366#M43277</guid>
      <dc:creator>gourinaik98</dc:creator>
      <dc:date>2020-03-04T09:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting or matching a string in a service</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Splitting-or-matching-a-string-in-a-service/m-p/652368#M43278</link>
      <description>&lt;P&gt;u mean replace the code starting from var params... till the end, right? If so, then it isnt working&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 09:21:15 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Splitting-or-matching-a-string-in-a-service/m-p/652368#M43278</guid>
      <dc:creator>gourinaik98</dc:creator>
      <dc:date>2020-03-04T09:21:15Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting or matching a string in a service</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Splitting-or-matching-a-string-in-a-service/m-p/652371#M43281</link>
      <description>&lt;P&gt;Those two lines are equivalent to the code snippet that you provided in your previous message, just shorter.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 09:22:28 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Splitting-or-matching-a-string-in-a-service/m-p/652371#M43281</guid>
      <dc:creator>Constantine</dc:creator>
      <dc:date>2020-03-04T09:22:28Z</dc:date>
    </item>
  </channel>
</rss>

