public class StringUtils extends Object
| 构造器和说明 |
|---|
StringUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
camelize(String word)
Camelize name (parameter, property, method, etc) with upper case for first letter
copied from Twitter elephant bird
https://github.com/twitter/elephant-bird/blob/master/core/src/main/java/com/twitter/elephantbird/util/Strings.java
|
static String |
camelize(String word,
boolean lowercaseFirstLetter)
Camelize name (parameter, property, method, etc)
|
static String |
dashize(String word)
Dashize the given word.
|
static String |
escape(String name,
Map<String,String> replacementMap,
List<String> charactersToAllow,
String appendToReplacement)
Return the name with escaped characters.
|
static String |
underscore(String word)
Underscore the given word.
|
public static String underscore(String word)
word - The wordpublic static String dashize(String word)
word - The wordpublic static String camelize(String word)
word - string to be camelizepublic static String camelize(String word, boolean lowercaseFirstLetter)
word - string to be camelizelowercaseFirstLetter - lower case for first letter if set to truepublic static String escape(String name, Map<String,String> replacementMap, List<String> charactersToAllow, String appendToReplacement)
name - the name to be escapedreplacementMap - map of replacement characters for non-allowed characterscharactersToAllow - characters that are not escapedappendToReplacement - String to append to replaced characters.throws Runtime exception as word is not escaped properly.
Copyright © 2019. All rights reserved.