<?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: Sorting words in a string in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Sorting-words-in-a-string/m-p/699442#M88437</link>
    <description>&lt;P&gt;I still would suggest using Concat Items() in cases like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

string = "sort this sentence";
string_list = Sort List(Words(string));
Sorted_string = Concat Items(string_list, " "); 
Show(string, string_list, Sorted_string);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;string = "sort this sentence";
string_list = {"sentence", "sort", "this"};
Sorted_string = "sentence sort this";&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 16 Nov 2023 18:51:52 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2023-11-16T18:51:52Z</dc:date>
    <item>
      <title>Sorting words in a string</title>
      <link>https://community.jmp.com/t5/Discussions/Sorting-words-in-a-string/m-p/699408#M88430</link>
      <description>&lt;P&gt;I would like to sort words alphabetically in a string.&amp;nbsp; I am stuck trying to get the list back into one string.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;string= "sort this sentence";
string_list = sort list(words(string ));&amp;nbsp; //&amp;nbsp;string_list = {"sentence", "sort", "this"};
Sorted_string = (string_list);&amp;nbsp; // not sure how to create Sorted_string = "sentence sort this"
show(string, string_list, Sorted_string);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Nov 2023 17:56:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Sorting-words-in-a-string/m-p/699408#M88430</guid>
      <dc:creator>justvince</dc:creator>
      <dc:date>2023-11-16T17:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting words in a string</title>
      <link>https://community.jmp.com/t5/Discussions/Sorting-words-in-a-string/m-p/699417#M88431</link>
      <description>&lt;P&gt;In JMP you can use &lt;A href="http://string=%20&amp;quot;sort this sentence&amp;quot;; string_list = sort list(words(string ));  // string_list = {&amp;quot;sentence&amp;quot;, &amp;quot;sort&amp;quot;, &amp;quot;this&amp;quot;};" target="_blank" rel="noopener"&gt;Concat Items()&lt;/A&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
Concat Items({"www", "jmp", "com"}, "."); //"www.jmp.com"&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Nov 2023 18:15:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Sorting-words-in-a-string/m-p/699417#M88431</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-11-16T18:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting words in a string</title>
      <link>https://community.jmp.com/t5/Discussions/Sorting-words-in-a-string/m-p/699433#M88435</link>
      <description>&lt;P&gt;Thanks you got me on the right track.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;string= "sort this sentence";
string_list = sort list(words(string));
sorting_string = "";
for(i=1, i&amp;lt;=nitems(string_list), i++,
	if(i&amp;lt;nitems(string_list),
		Sorting_string = concat(sorting_string, string_list[i], " ");
		,
		Sorting_string = concat(sorting_string, string_list[i]);
	);
);
show(string, string_list, Sorting_string);&lt;BR /&gt;&lt;BR /&gt;----------------&lt;BR /&gt;Log:&lt;BR /&gt;string = "sort this sentence";&lt;BR /&gt;string_list = {"sentence", "sort", "this"};&lt;BR /&gt;Sorting_string = "sentence sort this";&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Nov 2023 18:46:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Sorting-words-in-a-string/m-p/699433#M88435</guid>
      <dc:creator>justvince</dc:creator>
      <dc:date>2023-11-16T18:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting words in a string</title>
      <link>https://community.jmp.com/t5/Discussions/Sorting-words-in-a-string/m-p/699442#M88437</link>
      <description>&lt;P&gt;I still would suggest using Concat Items() in cases like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

string = "sort this sentence";
string_list = Sort List(Words(string));
Sorted_string = Concat Items(string_list, " "); 
Show(string, string_list, Sorted_string);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;string = "sort this sentence";
string_list = {"sentence", "sort", "this"};
Sorted_string = "sentence sort this";&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Nov 2023 18:51:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Sorting-words-in-a-string/m-p/699442#M88437</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-11-16T18:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting words in a string</title>
      <link>https://community.jmp.com/t5/Discussions/Sorting-words-in-a-string/m-p/699479#M88438</link>
      <description>&lt;P&gt;Perfect! Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2023 19:49:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Sorting-words-in-a-string/m-p/699479#M88438</guid>
      <dc:creator>justvince</dc:creator>
      <dc:date>2023-11-16T19:49:40Z</dc:date>
    </item>
  </channel>
</rss>

