title: How to remove particular String from String url
body: <p>I have to remove this.</p>
  <pre class="lang-java prettyprint-override"><code>String removeKey = &quot;problem_keys&quot;;
  </code></pre>
  <p><strong>Code</strong></p>
  <pre class="lang-java prettyprint-override"><code>public class Solution {
      
  public static void main(String args[]) {
      
          String removeKey = &quot;problem_keys&quot;;
          String url = &quot;{\&quot;arrival_mode:Self Drop;schedule:2020-09-10;payment_mode:Pay Online;address_id:67052;problem_id:11;problem_name:Abnormal noise;first:2000;product_name:demo tc;category_name:selfby;brand_name:bpl;transaction_type:Request;type:Display;problem_keys:1,35,3,4,5,6,7,15,16,11,12,16;\&quot;;}&quot;;
          StringBuffer sb = new StringBuffer(url);
          removeKey(sb, removeKey);
          System.out.println(sb.toString());
      }
  
      public static void removeKey(StringBuffer url, String removeKey) {
          int sIndex = url.indexOf(removeKey);
          while (url.charAt(sIndex) != ';') {
              url.deleteCharAt(sIndex);
          }
          url.deleteCharAt(sIndex);
      }
  }
  </code></pre>
  <p>Expected output.</p>
  <pre><code>{&quot;arrival_mode:Self Drop;schedule:2020-09-10;payment_mode:Pay Online;address_id:67052;problem_id:11;problem_name:Abnormal noise;first:2000;product_name:demo tc;category_name:selfby;brand_name:bpl;transaction_type:Request;type:Display;}&quot;;
  </code></pre>