<?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: Case Insensitive searches using contains in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Case-Insensitive-searches-using-contains/m-p/569313#M77991</link>
    <description>&lt;P&gt;For the record, a couple times a year this case sensitivity with Contains() bugs me. It may be a personal problem, but I dislike having to add that For loop to make a list all upper or lower case for future use with Contains(). I wish Contains had a case sensitivity option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My preferred method is this to force the case for all items in a list:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;myList = {"Steelers", "Falcons", "rams", "SeaHawks"};
myNewList = Words(Upper Case(Concat Items(myList)));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers&lt;/P&gt;</description>
    <pubDate>Tue, 15 Nov 2022 11:29:58 GMT</pubDate>
    <dc:creator>jay_holavarri</dc:creator>
    <dc:date>2022-11-15T11:29:58Z</dc:date>
    <item>
      <title>Case Insensitive searches using contains</title>
      <link>https://community.jmp.com/t5/Discussions/Case-Insensitive-searches-using-contains/m-p/108409#M39446</link>
      <description>&lt;P&gt;I am using the following piece of code to check if the list cn contains "col_name" and if yes rename it as Target.The problem is col_name can be all upper case or lowercase and there is no way for me to control that.How do I make sure that the code gets executed irrespective of the case?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If( Contains( cn ,Lowercase("col_name") ),  


:"col_name" &amp;lt;&amp;lt; Set name("Target");

);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 12:28:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Case-Insensitive-searches-using-contains/m-p/108409#M39446</guid>
      <dc:creator>ENTHU</dc:creator>
      <dc:date>2019-01-31T12:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: Case Insensitive searches using contains</title>
      <link>https://community.jmp.com/t5/Discussions/Case-Insensitive-searches-using-contains/m-p/108443#M39448</link>
      <description>&lt;P&gt;&lt;FONT color="#000000" face="Consolas" size="2"&gt;hello, &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000" face="Consolas" size="2"&gt;i think you can apply "substitute" ... follow the below example&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000dd" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000dd" face="Consolas" size="2"&gt;Names Default To Here&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;( &lt;/FONT&gt;&lt;FONT color="#008080" face="Consolas" size="2"&gt;1&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; );&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt;lst = {&lt;/FONT&gt;&lt;FONT color="#800080" face="Consolas" size="2"&gt;"a"&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;, &lt;/FONT&gt;&lt;FONT color="#800080" face="Consolas" size="2"&gt;"lowercase"&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;, &lt;/FONT&gt;&lt;FONT color="#800080" face="Consolas" size="2"&gt;"c"&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;};&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000dd" face="Consolas" size="2"&gt;Substitute&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;( lst, &lt;/FONT&gt;&lt;FONT color="#800080" face="Consolas" size="2"&gt;"lowercase"&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;, &lt;/FONT&gt;&lt;FONT color="#800080" face="Consolas" size="2"&gt;"Target"&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; );&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt;ciao&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt;Gianpaolo&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 13:00:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Case-Insensitive-searches-using-contains/m-p/108443#M39448</guid>
      <dc:creator>gianpaolo</dc:creator>
      <dc:date>2019-01-31T13:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: Case Insensitive searches using contains</title>
      <link>https://community.jmp.com/t5/Discussions/Case-Insensitive-searches-using-contains/m-p/108444#M39449</link>
      <description>What is "cn"?  A List, a String, an Associative Array???&lt;BR /&gt;Is "col_name" supposed to be referring to the name of a column?&lt;BR /&gt;&lt;BR /&gt;Please provide more specifics&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 31 Jan 2019 13:06:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Case-Insensitive-searches-using-contains/m-p/108444#M39449</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-01-31T13:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: Case Insensitive searches using contains</title>
      <link>https://community.jmp.com/t5/Discussions/Case-Insensitive-searches-using-contains/m-p/108448#M39452</link>
      <description>&lt;P&gt;There's no need to use lowercase() on col_name because it's already in lowercase.&amp;nbsp; This code will do what you want:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = New Table( "Untitled 2", Add Rows( 1 ),
	New Column( "COL_Name", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [1] ) ),
	New Column( "Column 2", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [2] ) ),
	New Column( "Column 3", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [3] ) )
);
cn_list = dt &amp;lt;&amp;lt; get column names(string);
for (i = 1, i &amp;lt;= nitems(cn_list), i++,
	cn_list[i] = lowercase(cn_list[i]);
);

If( Contains( cn_list, "col_name" ),
	:"col_name" &amp;lt;&amp;lt; Set name("Target");
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 31 Jan 2019 14:22:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Case-Insensitive-searches-using-contains/m-p/108448#M39452</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2019-01-31T14:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: Case Insensitive searches using contains</title>
      <link>https://community.jmp.com/t5/Discussions/Case-Insensitive-searches-using-contains/m-p/569313#M77991</link>
      <description>&lt;P&gt;For the record, a couple times a year this case sensitivity with Contains() bugs me. It may be a personal problem, but I dislike having to add that For loop to make a list all upper or lower case for future use with Contains(). I wish Contains had a case sensitivity option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My preferred method is this to force the case for all items in a list:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;myList = {"Steelers", "Falcons", "rams", "SeaHawks"};
myNewList = Words(Upper Case(Concat Items(myList)));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 11:29:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Case-Insensitive-searches-using-contains/m-p/569313#M77991</guid>
      <dc:creator>jay_holavarri</dc:creator>
      <dc:date>2022-11-15T11:29:58Z</dc:date>
    </item>
  </channel>
</rss>

