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. wikioi 1154 能量项链

    题目描述 Description 在Mars星球上,每个Mars人都随身佩带着一串能量项链.在项链上有N颗能量珠.能量珠是一颗有头标记与尾标记的珠子,这些标记对应着某个正整数.并且,对于相邻的两颗珠子 ...

  2. UVa657 The die is cast

    // 题意:给一个图案,其中'.'表示背景,非'.'字符组成的连通块为筛子.每个筛子里又包含两种字符,其中'X'组成的连通块表示筛子上的点 // 统计每个筛子里有多少个"X"连通块 ...

  3. mac下批量删除.svn文件

    mac下.svn是隐藏文件,而且即使我们调成可见的,一个一个删也很麻烦.今天正好同事问起来这个命令,于是想可能有些人也需要,于是还是放到博客里吧 命令比较简单,其实就是一条linux命令,打开终端,首 ...

  4. 关于MVC中DropDownListFor的一个bug

    如以下代码: //后台 代码 ViewData["source_type"] = new List<SelectListItem> { "}, "} ...

  5. C# 启动外部程序的几种方法

    . 启动外部程序,不等待其退出. . 启动外部程序,等待其退出. . 启动外部程序,无限等待其退出. . 启动外部程序,通过事件监视其退出. // using System.Diagnostics; ...

  6. 文本编辑器Nano实用快捷键

    一.复制.剪切和粘贴文本 1.行复制.剪切和粘贴 Alt+6:复制光标所在行. Ctrl+K:剪切光标所在行. Ctrl+U:粘贴. 2.自由复制.剪切和粘贴 自由复制: Ctrl+6:设置复制文本的 ...

  7. Python实践之(七)逻辑回归(Logistic Regression)

    机器学习算法与Python实践之(七)逻辑回归(Logistic Regression) zouxy09@qq.com http://blog.csdn.net/zouxy09 机器学习算法与Pyth ...

  8. C#综合揭秘——Entity Framework 并发处理详解

    引言 在软件开发过程中,并发控制是确保及时纠正由并发操作导致的错误的一种机制.从 ADO.NET 到 LINQ to SQL 再到如今的 ADO.NET Entity Framework,.NET 都 ...

  9. 利用 Composer 完善自己的 PHP 框架(二)——发送邮件

    本教程示例代码见 https://github.com/johnlui/My-First-Framework-based-on-Composer 回顾 上一篇文章中,我们手工建造了一个简易的视图加载器 ...

  10. java_文件类

    例一:创建文件 package java文件类; import java.io.File; import java.io.IOException; public class aasd { public ...