Android JSON Remove removeJsonPoint(String json, String... points)

Here you can find the source of removeJsonPoint(String json, String... points)

Description

remove Json Point

Declaration

public static String removeJsonPoint(String json, String... points) 

Method Source Code

//package com.java2s;

public class Main {

    public static String removeJsonPoint(String json, String... points) {
        String result = json;// www  .j  av  a  2s.co  m
        int len = points.length;
        for (int i = 0; i < len; i++) {
            int index = json.indexOf("\"" + points[i] + "\"");
            result = json.substring(0, index); // remove point
            int index2 = json.indexOf("\",", index);
            result += json.substring(index2 + 2); // remove ",
            json = result;
        }
        return result;
    }
}

Related

  1. replace(String str, JSONObject replacementMap)