//判断空
System.out.println(StringUtils.isEmpty(null)); // true
System.out.println(StringUtils.isEmpty("")); // true
System.out.println(StringUtils.isEmpty(" ")); // false
System.out.println(StringUtils.isEmpty("abc")); // false
//判断是否空白
System.out.println(StringUtils.isBlank(null)); // true
System.out.println(StringUtils.isBlank("")); // true
System.out.println(StringUtils.isBlank(" ")); // true
System.out.println(StringUtils.isBlank("abc")); // false
//去除首尾空白
System.out.println(StringUtils.trim(" abc "));// abc
System.out.println(StringUtils.strip(" abc")); // abc
System.out.println(StringUtils.strip("abc ")); // abc
System.out.println(StringUtils.strip(" abc
")); // abc
System.out.println(StringUtils.strip(" a bc
")); // a bc
String target = "
abc";
System.out.println(IsEmptyTest.test(target));
/**
* 是否空白字符
*/
System.out.println(StringUtils.isWhitespace("")); // true
System.out.println(StringUtils.isWhitespace(" ")); // true
/**
* 简略
*/
System.out.println(StringUtils.abbreviate("thunisoft", 7)); // thun...
System.out.println(StringUtils.abbreviate("thunisoft", 5)); // th...
String str = "thunisoft";
/**
* 首字母大写
*/
System.out.println(StringUtils.capitalize("thunisoft")); // Thunisoft
//左侧填充
System.out.println(StringUtils.leftPad("123", 6, "0"));// 000123
//右侧填充
System.out.println(StringUtils.rightPad("123", 6, "0"));// 123000
System.out.println(StringUtils.center("thunisoft", 15)); // thunisoft(左侧填充空白)
System.out.println(StringUtils.center("thunisoft", 15, "-")); // ---thunisoft---- (左右填充)
/**
* 去除换行
*/
System.out.println("\r" + "thunisoft" + "\r");
System.out.println(StringUtils.chomp("\r" + "thunisoft" + "\r"));
/**
* 删掉最后一个字符
*/
System.out.println(StringUtils.chop("thunisoft")); // thunisof
/**
* 找出两个字符不一样的位置
*/
System.out.println(StringUtils.indexOfDifference("thunisoft", "thunisofff")); // 8
System.out.println(StringUtils.difference("thunisoft", "thunisofff")); // ff
/**
* remove
*/
System.out.println(StringUtils.remove("thunisoft", "t")); // hunisof
/**
* 重复一个字符串n次
*/
System.out.println(StringUtils.repeat("thunisoft", 3)); // thunisoftthunisoftthunisoft
|
相关推荐
org.apache.commons.lang.ClassUtils.class org.apache.commons.lang.Entities$ArrayEntityMap.class org.apache.commons.lang.Entities$BinaryEntityMap.class org.apache.commons.lang.Entities$EntityMap....
org.apache.commons相关的所以jar包,包括commons-beanutils-1.8.0-bin.zip;commons-betwixt-0.8.zip;commons-cli-1.1.zip;commons-codec-1.3.zip;commons-collections-3.2.1-bin.zip;commons-digester-1.8.zip...
Apache Commons Compress ( commons-compress-1.13-bin.zip)
Java字符串加密使用到的一个jar包 commons-lang3-3.1...org.apache.commons.lang3.ClassUtils.class org.apache.commons.lang3.Validate.class org.apache.commons.lang3.SystemUtils.class 。。。。。。。。。。。。。
org.apache.commons.lang.ClassUtils.class org.apache.commons.lang.Entities$ArrayEntityMap.class org.apache.commons.lang.Entities$BinaryEntityMap.class org.apache.commons.lang.Entities$EntityMap.class ...
commons-dbutils包是Apache开源组织提供的用于操作数据库的工具包。简单来讲,这个工具包就是用来更加方便我们操作数据库的,最近工作中使用了一下,感觉确实方便很多,基本告别自己封装JDBC代码对数据库进行增删改...
org.apache.commons.lang3.ClassUtils 源码中文注释,之后会加上其他的工具类注释,方便以后复习阅读
这一组API的所有包名都以org.apache.commons.lang开头,共有如下8个包: org.apache.commons.lang org.apache.commons.lang.builder org.apache.commons.lang.enum org.apache.commons.lang.enums org.apache....
apache-common系列中的重要的成员:apache-common-collections。包中对Java中的集合类进行了一定的补充,定义了一些全新的集合,当然也是实现了Collection接口的,比如Bag,BidiMap。同时拥有新版本的原有集合,比如...
commons-beanutils.chm帮助文档 commons-beanutil开源库是apache组织的一个基础的开源库。为apache中很多类提供工具方法。学习它是学习其它开源库实现的基础。...本文研究的是v1.7版本号的commons-utils类库。
使用base64加解密的jar包,提供三种,对应就有三种方法。详细操作博客里有,不会的小伙伴可以自己去查看!啊啊啊啊,还不够100字。
java 开发工具commons-lang3-8.1 jar包,有org.apache.commons.lang3.StringUtils; org.apache.commons.lang3.reflect.FieldUtils;等类
commons各种jar包下载 commons-beanutils-1.8.3.jar commons-codec-1.7.jar commons-collections-3.2.1.jar commons-dbcp-1.4.jar commons-digester-2.1.jar commons-jexl-2.1.1.jar commons-lang-2.6.jar commons-...
它是Java Apache Commons的某些字符串操作库的Go实现。 GoUtils包括以下Java Apache Commons类: WordUtils RandomStringUtils StringUtils(部分实现)安装如果您在系统上设置了Go,请从命令行/终端内的GOPATH目录...
org.apache.commons的所有jar包:commons-io-1.4.jar、commons-fileupload-1.2.1.jar等等
继承了org.apache.commons.lang3.StringUtils工具类,加入了部分常用方法,使用时直接添加到项目的公共utils下,同时在pom.xml加入依赖: <!-- ...
import org.apache.commons.codec.binary.Base64; /* * AES加解密算法 * * @author jueyue * 加密用的Key 可以用26个字母和数字组成,最好不要用保留字符,虽然不会错,至于怎么裁决,个人看情况而定 ...
io utils 是apache 提供的方便数据操作的jar包,此文档有助于快速入门
org.apache.commons:commons-lang3:3.4 com.google.collections:google-collections:1.0 添加到您的项目 该库可从 只需添加 compile 'io.seventyone:mongo-utils:0.0.2' 对你的依赖。 该代码已记录在案,随后将...
这个包类似utils,主要是最简单的utils方法的集合,我不建议自己实现utils类,毕竟apache-commons和guava都已经帮我们实现了很多,主要是脚手架内部需要使用的方法封装,如类扫描等 这里面重点关注...