Skip to content

Commit 989ac59

Browse files
StringUtils的例子
1 parent b22b0c9 commit 989ac59

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/main/java/com/IOUtilsDemo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class IOUtilsDemo {
1818
* @param str
1919
* @param length
2020
*/
21-
public static void readTest(String str,int length){
21+
public static void read(String str, int length){
2222
try{
2323
byte[] bytes = new byte[length];
2424
InputStream is = IOUtils.toInputStream(str);

src/main/java/com/StringUtilsDemo.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
import org.apache.commons.lang3.StringUtils;
44

55
/**
6-
* Created by lenovo on 二月
6+
* 测试运行。见test.com文件夹的测试类
7+
* StringUtils中的方法大多是不会对null报空指针异常的。
78
*/
89
public class StringUtilsDemo {
910
public static void remove(){
@@ -27,6 +28,17 @@ public static void empty(){
2728
;
2829
}
2930

31+
public static void equalsIgnoreCase(){
32+
if(StringUtils.equalsIgnoreCase("abc","Abc")) {
33+
System.out.println("第一组字符串忽略大小写是一样的");
34+
}
35+
36+
if(StringUtils.equalsIgnoreCase(" ","")){
37+
System.out.println("第二组字符串忽略大小写是一样的");
38+
}
39+
}
40+
41+
3042
public static void main(String[] args) {
3143

3244
}

0 commit comments

Comments
 (0)