Package pascal.taie.util
Class Strings
java.lang.Object
pascal.taie.util.Strings
Static utility methods for
String
.-
Method Summary
Modifier and TypeMethodDescriptionstatic String
capitalize
(String str) Capitalizes aString
, changing the first letter to upper case as perCharacter.toUpperCase(char)
.static String
Escapes special characters in a given string by replacing them with their corresponding escape sequences.
-
Method Details
-
capitalize
Capitalizes aString
, changing the first letter to upper case as perCharacter.toUpperCase(char)
. No other letters are changed. -
escape
Escapes special characters in a given string by replacing them with their corresponding escape sequences. If the input string is null or empty, the method returns it unchanged.- Parameters:
str
- the input string to be escaped- Returns:
- a string with special characters replaced by their corresponding escape sequences, or the original string if it is null or empty
-