title: Mobile phone, Redirect adding %20 to parameter
body: <p>I have a mobile app with a few folders. These folders are used as variables that I will add to parameters:</p>
  
  <pre><code>        //Get the URL
          string url = HttpContext.Current.Request.Url.AbsolutePath;
  
          //Location
          string location = "";
  
          //Check if string contains /
          if (url.Contains('/'))
          {
              //Get location
              string[] words = url.Split('/');
  
              //Set location 
              location = words[1];
  
              //Now check if string contains ?
              if (location.Contains('?'))
              {
                  //Remove ?
                  string[] removeQ = location.Split('?');
  
                  //Reset location
                  location = removeQ[0];
              }
  
          }
  </code></pre>
  
  <p>After I the path from the URL I have to redirect depending on the phone type: </p>
  
  <pre><code>        if (Request.UserAgent.ToUpper().Contains("BLACKBERRY"))
          {
              //Now we check the version
              if (double.Parse(Request.Browser.Version) &lt;= 5)
              {
                  Response.Redirect("http://myWebsite.com/Default.aspx?location= " + location);
              }
              else if (double.Parse(Request.Browser.Version) &gt;= 6)
              {
                  Response.Redirect("http://myWebsite.com/Default.aspx?location= " + location);
              }
              else
              {
                  Response.Redirect("http://myWebsite.com/Default.aspx?location= " + location);
              }
  
          }
          else if (Request.UserAgent.ToUpper().Contains("HTC")) //HTC phones cannot handle JQuery mobile
          {
              Response.Redirect("http://myWebsite.com/Default.aspx?location= " + location);
          }
          else if (Request.UserAgent.ToUpper().Contains("ANDROID")) //Certain androids are out of date
          {
              if (double.Parse(Request.Browser.Version) &gt; 2)
              {
                  Response.Redirect("http://myWebsite.com/Default.aspx?location= " + location);
              }
              else
              {
                  Response.Redirect("http://myWebsite.com/Default.aspx?location= " + location);
              }
  
          }
          else
          {
              Response.Redirect("http://myWebsite.com/Default.aspx?location= " + location);
          }
      }
  </code></pre>
  
  <p>The problem is that it <code>location</code> will have an "%20" added to the front. This will not happen if I test it on a desktop, only on phones.</p>
  
  <p>Why is this happening? How can I prevent this?</p>