其他分享
首页 > 其他分享> > 5月23日--建国()

5月23日--建国()

作者:互联网

彻底被完虐了,我是小丑WANG。

1.IMPL,IMPL,IMPL,IMPL,IMPL,IMPL,IMPL,IMPL,IMPL,IMPL,IMPL,IMPL,IMPL,IMPL,IMPL

2. LIST,LIST,LIST,LIST,LIST,LIST,LIST,LIST,LIST,LIST,LIST,LIST,LIST,LIST,LIST

3. MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP,MAP

4. JSON,JSON,JSON,JSON,JSOM,JSON,JSON,JSON,JSON,JSON,JSON,JSON,JSON,JSON,JSON

5. 字符串截取:

1.字符串的截取方法1:substring(index1,index2);---包头不包尾---空格也占一个位置。

String str="我 叫 周 建 国 J G";
System.out.println("str:"+str);
String str2 = str.substring(1,4);
System.out.println("str2:"+str2);

2.split正则表达式方式。---将字符串按照分割符截取,以数组形式返回---regex正则表达式的意思

String str3 = "hello,world,hello,java";
String[] split = str3.split(","); // 返回的是数组[]
for (String s : split) {
    System.out.println(s);
}

6. 判断字符串不为空的方法---必须先判断str==null在进行第二步判断。

// 1.str!=null || str.length!=0
String str = "hello,java";
if (str!=null||str.length()!=0){
    System.out.println("true");
}else {
    System.out.println(false);
}
// 2.str!=null || str.isEmpty()
if (str==null || str.isEmpty()){
    System.out.println("false");
}else {
    System.out.println("true");
}
// 3.str==null || "".equals()
if (str==null||"".equals(str)){
    System.out.println("false");
}else {
    System.out.println("true");
}

7. IMPL,JSON,LIST,MAP四大天王。

8. 打印对象:UserDO(id=1, name=周建国, age=22)

9. 对象转JSON:{"buyNum":999,"cacheCode":"2mb"}

10. 取JSON里面String的结果集中某个字段的值:JSON-->JSONObject-->JSONArray-->getJSONObject--->getString/xxx。OrderFaceSheetBalanceQueryServiceImpl

11. 把对象DO添加到list<对象里面>:list.add(对象DO);

标签:MAP,23,--,LIST,建国,JSON,str,println,IMPL
来源: https://www.cnblogs.com/bpbpbp/p/16304020.html