/**
* 获取string字符串指定内容
*/
private static String getFullDepartmentName(String result) {
for (String s : result.split(",")) {
if (s.startsWith("\"fullDepartmentName\"")){
String[] split = s.split(":");
String r = split[1];
String s1 = customTrim(r, '"');
System.out.println(s1);
return s1;
}
}
return null;
}
/**
* 删除字符串首尾指定字符
*/
public static String customTrim(String str, char c) {
char[] chars = str.toCharArray();
int len = chars.length;
int st = 0;
while ( (st < len) && (chars[st] == c) ){
st ++;
}
while ( (st < len) && (chars[len-1] == c) ){
len --;
}
return (st > 0) || (len < chars.length) ? str.substring(st, len) : str;
}