http://commons.apache.org/proper/commons-lang/javadocs/api-release/org/apache/commons/lang3/package-summary.html

1. Commons Lang 是对java.lang的一个扩展

2. String

StringEscapeUtils 提供随机的一段字符串,一般用于产生随机密码   StringEscapeUtils.random(int count)

RandomStringUtils 对Java, Java Script, HTML and XML 提供转义

StringUtils

  • IsEmpty/IsBlank - checks if a String contains text
  • 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
  • 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

3. Character

  • CharSet
  • CharRange
  • CharSetUtils
  • CharUtils

4. JVM interaction - SystemUtils, CharEncoding

  • SystemUtils: Helpers for java.lang.System
  • CharEncoding

5.Serialization

  • SerializationUtils

    •   SerializationUtils.clone(T object)  Deep clone an Object using serialization.
  • SerializationException

6.Assorted functions -

  • ObjectUtils
  • ClassUtils
  • ArrayUtils
    • ArrayUtils provides singleton empty arrays for all the basic types. These will largely be of use in the Collections API with its toArray methods, but also will be of use with methods which want to return an empty array on error.
    • add(xxx[], xxx) will add a primitive type to an array, resizing the array as you'd expect. Object is also supported.
    • clone(xxx[]) clones a primitive or Object array.
    • contains(xxx[], xxx) searches for a primitive or Object in a primitive or Object array.
    • getLength(Object) returns the length of any array or an IllegalArgumentException if the parameter is not an array. hashCode(Object)equals(Object, Object)toString(Object)
    • indexOf(xxx[], xxx) and indexOf(xxx[], xxx, int) are copies of the classic String methods, but this time for primitive/Object arrays. In addition, a lastIndexOf set of methods exists.
    • isEmpty(xxx[]) lets you know if an array is zero-sized or null.
    • isSameLength(xxx[], xxx[]) returns true if the arrays are the same length.
    • Along side the add methods, there are also remove methods of two types. The first type remove the value at an index, remove(xxx[], int), while the second type remove the first value from the array, remove(xxx[], xxx).
    • Nearing the end now. The reverse(xxx[]) method turns an array around.
    • The subarray(xxx[], int, int) method splices an array out of a larger array.
    • Primitive to primitive wrapper conversion is handled by the toObject(xxx[]) and toPrimitive(Xxx[]) methods.
    • ArrayUtils.toMap(Object[])
  • BooleanUtils  BooleanUtils.toBoolean(String)

7. Flotsam

  • BitField
  • Validate

Apache Commons Lang的更多相关文章

  1. 让时间处理简单化 【第三方扩展类库org.apache.commons.lang.time】

    JAVA的时间日期处理一直是一个比较复杂的问题,大多数程序员都不能很轻松的来处理这些问题.首先Java中关于时间的类,从 JDK 1.1 开始,Date的作用很有限,相应的功能已由Calendar与D ...

  2. 关于出现 org.apache.commons.lang.exception.NestableRuntimeException的解决方法

    最近做服务端和客户端之间的访问,出现了 org.apache.commons.lang.exception.NestableRuntimeException等状况.实在令人头大,翻到了一个很好的帖子说 ...

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

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

  4. java转换json需要导入的jar包,org/apache/commons/lang/exception/NestableRuntimeException

    缺少相应jar包都会有异常,根据异常找jar包导入......     这里我说下lang包,因为这个包我找了好半天:   我用的是: commons-lang3-3.1.jar  出现异常: jav ...

  5. org.apache.commons.lang.StringUtils类

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

  6. java.lang.NoClassDefFoundError: org/apache/commons/lang/exception/NestableRuntim [问题点数:40分,结帖人wangxiaohua_001]

    14:56:10.093 WARN!! Error for /butterfly/plugins/zhonghang/UsefulData/save_usefuldata.bshjava.lang.N ...

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

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

  8. ssh整合启动tomcat报java.lang.ClassNotFoundException: org.apache.commons.lang.xwork.StringUtils

    今天搭建了一个ssh项目环境,整合后,访问项目首页,登录不进去,控制台报错,后来调试代码后,在获取数据库数据后,返回到action时,又进入了action导致死循环,其实这里是两个问题,控制台报错如下 ...

  9. 转 java.lang.ClassNotFoundException: org.apache.commons.lang.exception.NestableRuntimeException

    转自:http://blog.csdn.net/zb0567/article/details/7893063 java.lang.ClassNotFoundException: org.apache. ...

  10. org.apache.commons.lang下的工具类

    1.org.apache.commons.lang.ArrayUtils 例子 package chongqingyusp; import java.util.Map; import org.apac ...

随机推荐

  1. [原创]win10 命令行出现问号而且无法chcp 936

    现象: 命令行中中文字符显示为问号,输入chcp 936会提示 invlalid page code. 解决: 设置-区域和语言-时钟,语言和区域-区域-更改位置-管理-非Unicode中所使用的语言 ...

  2. SQL Server 2008创建oracle链接服务器(心得)

    操作系统是32位的情况下,曾经没费太多时间创建好了到oracle的链接服务器.主要要点就是: 1.安装oracle精简客户端.当时我用的是版本比较低的“oracle9i310-客户端简化版”,安装好了 ...

  3. 关于ibatis中mysql的@变量问题作用域、污染问题

    搞了1天,过程不想多说,结论如下: ibatis.net 是有连接池的,用ab.exe 并发测试,可以测出默认的max连接数 ibatis.net的数据操作 xml 中可以用@变量,也就是 Sessi ...

  4. SVN强制退出,出现被锁的情况解决方法

    1. 打开终端 输入cd Desktop enter之后 输入ls enter键 2. 输入cd  文件名(比如IOS)enter键 3. 输入LS enter 4. find . | grep &q ...

  5. ios 使用AFN上传图片到服务器

    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; manager.responseSe ...

  6. spring " expected single matching bean but found 2" 问题一例。

    初入java,使用spring时遇到一个问题,左边是一个接口和实现.右边是service和实现. @Service@Transactional(rollbackFor = Exception.clas ...

  7. JSP实现 乘法口诀输出

    <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding= ...

  8. ionic项目 环境搭建及基本操作

    一.安装 1.安装node.js 3.安装ionic & cordova: 命令行输入:npm install –g cordova ionic 注:-g表示全局安装,也可以进入指定的目录安装 ...

  9. 我的nodejs学习之路1

    距离上次写文章类东西已经有4-5年了,猛然写东西有种提笔忘字的感觉. 言归正传,这是一篇记录我自己学习nodejs的文章,在写下这篇文章的时候我也不是什么大牛,也不是很了解nodejs这项技术.之所以 ...

  10. css样式增加&改变颜色

    .listyle{ color:blue; background-color:red /* background-color:"#006633" */ } .intro{ font ...