title: Java - replace all blank space in String with + sign for URL
body: <p>So I was looking on StackOverflow for the answer on this question but couldn't find one.</p>
  
  <p>I have an URL whose left and right part are always the same, but the part in a middle changes constantly. If there's only one word it works fine, but if there are multiple the URL brokes.</p>
  
  <p>I need to replace all the whitespace with plus (+) sign.</p>
  
  <p>I'm using this code with no luck:</p>
  
  <pre><code>String content = bioObj.getString("summary");
                      content = content.replaceAll(" ", "%20");
                      bio.setText(content);
  </code></pre>
  
  <p>Can anyone help?</p>
  
  <p>FULL CODE: </p>
  
  <pre><code>String finalUrlBio = bioUrlLeft+title+bioUrlRight;
  
          JsonObjectRequest bioRequest = new JsonObjectRequest(Request.Method.GET, finalUrlBio, (JSONObject) null, new Response.Listener&lt;JSONObject&gt;() {
              @Override
              public void onResponse(JSONObject response) {
                  try {
                      JSONObject artistObj = response.getJSONObject("artist");
                      JSONObject bioObj = artistObj.getJSONObject("bio");
                      String content = bioObj.getString("summary");
                      content = content.replaceAll("\\s","+");
                      bio.setText(content);
  
  
                  } catch (JSONException e) {
                      e.printStackTrace();
                  }
              }
          }, new Response.ErrorListener() {
              @Override
              public void onErrorResponse(VolleyError error) {
  
              }
          });
  
          AppController.getInstance().addToRequestQueue(bioRequest);
  </code></pre>
  
  <p>ERROR:</p>
  
  <pre><code>07-01 00:00:37.379 2793-2872/com.darioradecic.topmusicandartists E/Volley: [397649] BasicNetwork.performRequest: Unexpected response code 400 for http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&amp;artist=Red Hot Chili Peppers&amp;api_key=99b9ea4e41463638c76b4759d8b1da1d&amp;format=json
  </code></pre>