title: How to check if element exists in JSON array?
body: <pre><code>Json test = Json.emptyArray;
  test ~= "aaa";
  test ~= "bbb";
  test ~= "ccc";
  writeln(test);
  </code></pre>
  
  <p>output: <code>["aaa","bbb","ccc"]</code></p>
  
  <p>But How I can check if this array have element? I can't figure how to use <code>canFind</code> with JSON array. I am using <a href="http://vibed.org/api/vibe.data.json/" rel="nofollow">vibed json module</a>.</p>
  
  <pre><code>if(test.get!string[].canFind("aaa"))
  {
      writeln("founded");
  }
  </code></pre>
  
  <p>Does not work: <code>Got JSON of type array, expected string.</code></p>
  
  <p>If to do like this:</p>
  
  <pre><code>if(test.get!(string[]).canFind("aaa"))
  {
      writeln("founded");
  }
  </code></pre>
  
  <p><code>Error: static assert  "Unsupported JSON type 'string[]'. Only bool, long, std.bigint.BigInt, double, string, Json[] and Json[string] are allowed."</code></p>
  
  <p>With <code>to!string</code> and <code>toString</code> methods all work:</p>
  
  <pre><code>Json test = Json.emptyArray;
  test ~= "aaa";
  test ~= "bbb";
  test ~= "ccc";
  writeln(to!string(test));
  
  if(test.toString.canFind("aaa"))
  {
      writeln("founded");
  }
  </code></pre>
  
  <p>But if I do it's inside foreach:</p>
  
  <pre><code>foreach(Json v;visitorsInfo["result"])
  {
  if((v["passedtests"].toString).canFind("aaa"))
   {
      writeln("founded");
   }
  }
  </code></pre>
  
  <p>I am getting: <code>Error: v must be an array or pointer type, not Json</code>. What's wrong?</p>