Operations on String that are null safe.

IsEmpty/IsBlank - checks if a String is empty (判断字符串是否为空)

Trim/Strip - removes leading and trailing whitespace (删除前后的控制字符、空白字符)

Equals - compares two strings null-safe (判断字符串是否相等)

startsWith - check if a String starts with a prefix null-safe

endsWith - check if a String ends with a suffix null-safe

IndexOf/LastIndexOf/Contains - null-safe index-of checks

IndexOfAny/LastIndexOfAny/IndexOfAnyBut/LastIndexOfAnyBut - index-of any of a set of Strings

ContainsOnly/ContainsNone/ContainsAny - does String contains only/none/any of these characters

Substring/Left/Right/Mid - null-safe substring extractions

SubstringBefore/SubstringAfter/SubstringBetween - substring extraction relative to other strings (获得相对于分隔符位置的子串)

Split/Join - splits a String into an array of substrings and vice versa (拆分、拼接字符串)

Remove/Delete - removes part of a String

Replace/Overlay - Searches a String and replaces one String with another

Chomp/Chop - removes the last part of a String

AppendIfMissing - appends a suffix to the end of the String if not present (如果字符不以指定的后缀结尾,则在字符串后补充该后缀返回)

PrependIfMissing - prepends a prefix to the start of the String if not present (如果字符不以指定的前缀开头,则在字符串前补充该前缀返回)

LeftPad/RightPad/Center/Repeat - pads a String

UpperCase/LowerCase/SwapCase/Capitalize/Uncapitalize - changes the case of a String (改变字符的大小写)

CountMatches - counts the number of occurrences of one String in another

IsAlpha/IsNumeric/IsWhitespace/IsAsciiPrintable - checks the characters in a String

DefaultString - protects against a null input String (预防 null)

Reverse/ReverseDelimited - reverses a String (反转字符串)

Abbreviate - abbreviates a string using ellipsis

Difference - compares Strings and reports on their differences

LevenshteinDistance - the number of changes needed to change one String into another

More: JavaDoc

Commons Lang - StringUtils的更多相关文章

  1. org.apache.commons.lang.StringUtils中常用的方法

    org.apache.commons.lang.StringUtils中常用的方法,这里主要列举String中没有,且比较有用的方法: 1. 检查字符串是否为空: static boolean isB ...

  2. org.apache.commons.lang.StringUtils类

    org.apache.commons.lang.StringUtils类 本文摘自:(http://www.blogjava.net/japper/archive/2012/05/23/378946. ...

  3. java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils

    java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils Caused by: java.lang.ClassNotFou ...

  4. org.apache.commons.lang.StringUtils 中 Join 函数

    转自 http://my.oschina.net/zenglingfan/blog/134872 写代码的时候,经常会碰到需要把一个List中的每个元素,按逗号分隔转成字符串的需求,以前是自己写一段比 ...

  5. idea创建maven项目报错,Error initializing: org.codehaus.plexus.velocity.DefaultVelocityComponent@56da52a7 java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils

    学着使用idea,想创建个maven项目,但是出师不利,立马报错,贼尴尬,错误信息如下: D:\Develop\JDK\bin\java.exe -Dmaven.multiModuleProjectD ...

  6. org.apache.commons.lang.StringUtils的常用方法

    org.apache.commons.lang.StringUtils是apache的commons-lang-x.x.jar下的包,里面包含很多字符串操作方法, 官网(http://commons. ...

  7. org.apache.commons.lang.StringUtils

    org.apache.commons.lang.StringUtils 作为jdk中lang包的补充 检查CharSequence是否为空,null或者空格 CharSequence (CharBuf ...

  8. maven命令行创建web项目报错:java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils

    早上一上班就想新建一个web项目玩玩,没想到一敲命令创建就失败了,真是出师不利.各种折腾无果,当然我也可以用eclipse直接创建的,就是不甘心被这破问题给耍了.刚刚才发现问题原因,这个结果我也是醉了 ...

  9. apache.commons.lang.StringUtils 使用心得

    原文:http://blog.csdn.net/ye_sheng/article/details/48101901?ref=myread 在Java中我们用的最多的类应该就是String了.对于Str ...

  10. java.lang.NoSuchMethodError: org.apache.commons.lang.StringUtils.endsWith(Ljava/lang/String;Ljava/lang/String;)Z

    这是一个包冲突的典型错误,今天搞了一天.从错误信息就能看出是commons.lang出现的问题,解决方案:去掉新增加的conmons.lang依赖,加载其他的版本. 1.在编译之后的目录查看加载的包版 ...

随机推荐

  1. poj3041

    Asteroids Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 12162   Accepted: 6620 Descri ...

  2. 从最简单的HelloWorld理解MVP模式

    版权声明:本文为博主原创文章,转载请注明出处:http://www.cnblogs.com/joy99/p/6116855.html 大多数编程语言相关的学习书籍,都会以hello,world这个典型 ...

  3. 初学Android 一 基本开发环境

    Android平台架构 1.应用程序层: 核心应用程序和普通应用程序,他们都是平级的,都可以平等的调用下层. 2.应用程序框架:供上一层调用的API. 3.函数库: 不能被直接调用的C/C++库的集合 ...

  4. hibernate二级缓存ehcache

    与Session相对的是,SessionFactory也提供了相应的缓存机制.SessionFactory缓存可以依据功能和目的的不同而划分为内置缓存和外置缓存. SessionFactory的内置缓 ...

  5. wikioi 3116 高精度练习之加法

    题目描述 Description 给出两个正整数A和B,计算A+B的值.保证A和B的位数不超过500位. 输入描述 Input Description 读入两个用空格隔开的正整数 输出描述 Outpu ...

  6. Hadoop 2.0+YARN启动脚本分析与实战经验

    start-all.sh脚本现在已经废弃,推荐使用start-dfs.sh和start-yarn.sh分别启动HDFS和YARN. 在新一代的Hadoop里面HDFS称为了统一存储的平台,而YARN成 ...

  7. ResultSet转成java类对象

    在做web开发时遇到一个事情: 需要从mysql数据表中查询数据并遍历查询结果 这样最简单的方式是:查询到结果根据表中字段列表的顺序来一个个获取字段,但这样需要记住字段的顺序,操作起来不是那么方便.因 ...

  8. pjsip视频通信开发(上层应用)之数字键盘的制作

    在pjsip视频通信开发(上层应用)之EditText重写中我制作了一个显示输入内容的EditText,这里将制作一个数字键盘,其实跟计算器一样,最多的就是用TableLayout来实现,内部通过权重 ...

  9. [Ext JS 4] 实战之 带week(星期)的日期选择控件(三)

    前言 在 [Ext JS 4] 实战之 带week(星期)的日期选择控件(二) 的最后,有提到一个解决方案. 不过这方案有一个条件  ==> “2. 每年的周数从(1-52), 如果超过52 周 ...

  10. ios开发——实用技术篇Swift篇&地址薄、短信、邮件

    //返回按钮事件 @IBAction func backButtonClick() { self.navigationController?.popViewControllerAnimated(tru ...