zoukankan      html  css  js  c++  java
  • Class StringUtils

    StringUtils (Lang 2.3 API)

    Class StringUtils

    java.lang.Object
      extended by org.apache.commons.lang.StringUtils
    

    public class StringUtils
    
    extends Object

    Operations on String that are
    null safe.

    • IsEmpty/IsBlank
      - checks if a String contains text
    • Trim/Strip
      - removes leading and trailing whitespace
    • Equals
      - compares two strings null-safe
    • IndexOf/LastIndexOf/Contains
      - null-safe index-of checks
    • IndexOfAny/LastIndexOfAny/IndexOfAnyBut/LastIndexOfAnyBut
      - index-of any of a set of Strings
    • ContainsOnly/ContainsNone
      - does String contains only/none 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
    • 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 two Strings and reports on their differences
    • LevensteinDistance
      - the number of changes needed to change one String into another

    The StringUtils class defines certain words related to
    String handling.

  • 相关阅读:
    with一个对象,自动触发__enter__方法
    SQLAlchemy-Utils
    SQLAlchemy
    wtforms
    Python数据库连接池DBUtils(基于pymysql模块连接数据库)
    VMWare安装linux centos,安装中文输入法
    HttpServletRequest和ServletRequest的区别
    Java序列化
    mybatis循环取序列,值相同问题处理
    利用jdk将wsdl生成java代码
  • 原文地址:https://www.cnblogs.com/lexus/p/2393683.html
Copyright © 2011-2022 走看看