[Java]Apache Common Lang包的StringUtils类
2017-06-19 15:54
627 查看
记录
org.apache.commons.lang3.StringUtils类的用途
IsEmpty/IsBlank - checks if a String contains text Trim/Strip - removes leading and trailing whitespace Equals/Compare - 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 Rotate - rotate (circular shift) a String Reverse/ReverseDelimited - reverses a String Abbreviate - abbreviates a string using ellipsis or another given String Difference - compares Strings and reports on their differences LevenshteinDistance - the number of changes needed to change one String into another
相关文章推荐
- java.lang.UnsupportedClassVersionError: org/apache/cxf/common/injection/NoJSR250 Annotations
- java.lang.UnsupportedClassVersionError: org/apache/solr/common/params/SolrParams : Unsupported major
- java.lang.NoClassDefFoundError: org/apache/solr/common/params/SolrParams
- java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource的解决方法
- java.lang.NoClassDefFoundError: org/apache/commons/collections/map/LRUMap
- java.lang.ClassNotFoundException: org.apache.jasper.servlet.JspServlet.
- java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource的解决方法
- 解决 java.lang.NoClassDefFoundError: org /apache/xmlbeans/XmlException
- Apache Jakarta Common Lang 介绍
- struts2错误 : java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
- java.lang.ClassCastException: org.apache.struts.action.ActionMessage 错误
- java.lang.NoSuchMethodError: org.apache.commons.validator.Validator.setParameter(Ljava/lang/String;Ljava/lang/Object;)V解决方法
- Apache Jakarta Common Lang 介绍
- Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/xml/serializer/TreeWalker
- java.lang.NoClassDefFoundError:org/apache/commons/beanutils
- 找不到基本对象池:“java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool”解决方法
- java.lang.ClassCastException: org.apache.struts.taglib.bean.CookieTei
- 如何解决 tomcat 下 oracle 缓冲池 读取 clob 字段内容 时的错误 "java.lang.ClassCastException: org.apache.commons.dbcp.DelegatingResultSet "
- Validator问题及解决办法——java.lang.ClassCastException: org.apache.struts.validator.ValidatorForm cannot be cast to forms.RegisterForm
- nested exception is java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool