title: Split string with strtok (nested)
body: <p>I use an arduino MEGA to parse a the param part of an url. 
  It should not matter how the order of the parameters are. I have following code and I tried that with strtok.</p>
  
  <pre><code>char text[] = "ssid=SSID&amp;pwd=PASSWORD&amp;userId=1234"
  </code></pre>
  
  <p>and will split in</p>
  
  <pre><code>ssid=SSID
  pwd=PASSWORD
  userId=1234
  </code></pre>
  
  <p>and split it again in key and values</p>
  
  <pre><code>ssid
  SSID
  
  pwd
  PASSWORD
  
  userId
  1234
  </code></pre>
  
  <p>I tried to use strtok for the first split.</p>
  
  <pre><code>  char *ptr;
    ptr = strtok(params, "&amp;");
  
    while (ptr != NULL) {
      Serial.println(urlParam);
      ptr = strtok(NULL, "&amp;");
    }
  </code></pre>
  
  <p>and the output is as expected:</p>
  
  <p>Output:</p>
  
  <pre><code>ssid=SSID
  pwd=PASSWORD
  userId=1234
  </code></pre>
  
  <p>then the next split:</p>
  
  <pre><code>  char *ptr;
    ptr = strtok(params, "&amp;");
  
    while (ptr != NULL) {
  
      char *paramKey;
      char *paramValue;
      paramKey = strtok(ptr, "=");
      Serial.println(paramKey);
  
      if (paramKey == 'ssid'){
        paramValue = strtok(NULL, "=");
        Serial.println(paramValue);       
  
        ssidName = paramValue;
      }
  
      if (paramKey == 'pwd'){
        ...
      }
  
      if (paramKey == 'userId'){
        ...
      }       
  
      ptr = strtok(NULL, "&amp;");
    }
  </code></pre>
  
  <p>But the output is just</p>
  
  <pre><code>ssid
  SSID
  </code></pre>
  
  <p>Looks like the loop is not working properly.</p>
  
  <p>Where do I make the mistake?
  Is there any other way to resolve this string?</p>