【20004】Java常用方法

2020-04-20  本文已影响0人  终极蚂蚁
public static void main(String[] args) {
    String text = "{\"hello\":{\"test\":\"val\"}}";
    String pretty = JSON.toJSONString(JSON.parseObject(text), SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue,
            SerializerFeature.WriteDateUseDateFormat);
    System.out.println(pretty);
}
{
    "hello":{
        "test":"val"
    }
}
上一篇 下一篇

猜你喜欢

热点阅读