• Commons Lang


    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

  • 相关阅读:
    Masonry介绍与使用实践:快速上手Autolayout
    iOS:实现图片的无限轮播(二)---之使用第三方库SDCycleScrollView
    FMDB的使用方法
    ViewController的生命周期分析和使用
    使用Xcode7的Instruments检测解决iOS内存泄露
    IOS比较常用的第三方组件及应用源代码(持续更新中)
    SDWebImage的简单使用
    ant编译tomcat-web项目
    git命令记录
    zabbix问题恢复正常,但是图表中还是显示故障存在
  • 原文地址:https://www.cnblogs.com/huey/p/5630227.html
Copyright © 2020-2023  润新知