String str = "["3.28-6.47"]";
str = str.replaceAll("\\[", "");
str = str.replaceAll("\\]", "");
//去掉多余的双引号
str = str.replaceAll("\\\"", "");
{"fssj":"20170717145154","person1":"管理员","person2":"销售经理22","rybm_fsr":1,"rybm_jsr":3,"xtxxbm":125,"xxbt":"ddd","xxnr":"dddddd
/strong>dadadaddddd
decoration: underline;">ddfff","zt":"0"}
浏览器打开
通过js 提供的substring()就可以直接去除引号。(注意是小写,和
java
不同) var imgPath = JSON.stringify(api.pageParam.imgPath);
alert("1"+imgPath);
alert("2"+imgPath.length);
console.log(imgPath);
浏览器打开
private String SubString(String fdId) {
if(fdId.indexOf("\"")==0){
fdId = fdId.substring(1,fdId.length()); //
去掉
第一个 "
if(fdId.lastIndexOf("\"")==(fdId.length()-1)){
} fdId =
浏览器打开
str为“123”如果一个
双引号
:str1 = str.replace("\"","").replace("\"","");如果不确定有多少个
双引号
:str2 = str.replace(/\"/g, "");此方法为替换,也可用于去除制定字符,如:String str = "12/3";
str1 = str.replace("\/","");
str2 = str.replace(/\//g,
浏览器打开
<properties>
<httpclient.version>4.4.1</httpclient.version>
</properties>
<dependency>
<groupId>org.apache.httpcomp...
浏览器打开
1、获取json字符串,gson.toJson(entity);
2、通过fromJson方法将json字符串jsonStr转换为type类型,gson.fromJson(jsonStr,type);
在此过程中,gson.toJson(entity)获取到的json字符串如下:"{"name":"张三","age":17}",再转map
结果就成了"nam...
浏览器打开