关于StringUtils的常用方法

 
StringUtils.split(String, char)
 
 
* <pre>
* StringUtils.split(null, *)         = null
* StringUtils.split("", *)           = []
* StringUtils.split("a.b.c", '.')    = ["a", "b", "c"]
* StringUtils.split("a..b.c", '.')   = ["a", "b", "c"]
* StringUtils.split("a:b:c", '.')    = ["a:b:c"]
* StringUtils.split("a b c", ' ')    = ["a", "b", "c"]
* </pre>
StringUtils.startsWith(CharSequence, CharSequence)
 
* <pre>
* StringUtils.startsWith(null, null)      = true
* StringUtils.startsWith(null, "abc")     = false
* StringUtils.startsWith("abcdef", null)  = false
* StringUtils.startsWith("abcdef", "abc") = true
* StringUtils.startsWith("ABCDEF", "abc") = false
* </pre>
StringUtils.substringBetween(String, String)
 
     * <pre>
     * StringUtils.substringBetween(null, *)            = null
     * StringUtils.substringBetween("", "")             = ""
     * StringUtils.substringBetween("", "tag")          = null
     * StringUtils.substringBetween("tagabctag", null)  = null
     * StringUtils.substringBetween("tagabctag", "")    = ""
     * StringUtils.substringBetween("tagabctag", "tag") = "abc"
     * </pre>

 

posted @ 2018-08-30 16:47  JayInnn  阅读(945)  评论(0编辑  收藏  举报