{"id":2166,"date":"2010-11-29T02:00:30","date_gmt":"2010-11-28T20:30:30","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=2166"},"modified":"2010-11-29T02:01:16","modified_gmt":"2010-11-28T20:31:16","slug":"in-keyword-groovy","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/in-keyword-groovy\/","title":{"rendered":"&#8220;In&#8221; Keyword -Groovy"},"content":{"rendered":"<pre>keyword \"in\"  is used in Groovy to check whether element exists in Collection. \r\n\r\nExample List\r\n[groovy]\r\nString str = &quot;this is me &quot;\r\nList list = str.tokenize(&quot; &quot;)\r\nString word = &quot;this&quot;\r\nassert  word in list == true\r\nassert  &quot;hello&quot; in list == false\r\n[\/groovy]\r\n\r\n Example with Set [groovy]\r\nSet set = [&quot;this&quot;,&quot;is&quot;,&quot;me&quot;]\r\nString word = &quot;this&quot;\r\nassert  word in set == true\r\nassert  &quot;hello&quot; in set == false\r\n[\/groovy]\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>keyword &#8220;in&#8221; is used in Groovy to check whether element exists in Collection. Example List [groovy] String str = &quot;this is me &quot; List list = str.tokenize(&quot; &quot;) String word = &quot;this&quot; assert word in list == true assert &quot;hello&quot; in list == false [\/groovy] Example with Set [groovy] Set set = [&quot;this&quot;,&quot;is&quot;,&quot;me&quot;] String word [&hellip;]<\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":21},"categories":[7],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/2166"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=2166"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/2166\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=2166"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=2166"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=2166"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}