摘要:
1. String.trim() trim()是去掉首尾空格 2.str.replace(" ", ""); 去掉所有空格,包括首尾、中间 String str = " hell o "; String str2 = str.replaceAll(" ", ""); System.out.print 阅读全文
posted @ 2020-07-02 10:28
王大慧
阅读(594)
评论(0)
推荐(0)
摘要:
jdk8+以上引入了箭头函数,即J8的lambda表达式。 // 1. 不需要参数,返回值为 5 () -> 5 // 2. 接收一个参数(数字类型),返回其2倍的值 x -> 2 * x // 3. 接受2个参数(数字),并返回他们的差值 (x, y) -> x – y // 4. 接收2个int 阅读全文
posted @ 2020-07-02 10:27
王大慧
阅读(2936)
评论(0)
推荐(0)
浙公网安备 33010602011771号