public class StringTools
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
lineSeparator
Convenience field storing the system line separator.
|
| Constructor and Description |
|---|
StringTools() |
| Modifier and Type | Method and Description |
|---|---|
static char |
getCFormatChar(char c)
Returns the canonical C-string representation of c.
|
static java.lang.String |
getEscapedStringOf(java.lang.String fromString)
Returns fromString, but with non-isalpha() characters printed as
'\\unnnn'. |
static java.lang.String |
getQuotedStringOf(java.lang.String fromString)
Returns fromString, but with certain characters printed as
if they were in a Java string literal.
|
static java.lang.String |
getUnEscapedStringOf(java.lang.String str)
Returns a String de-escaping the
\\unnnn
representation for any escaped characters in the string. |
static java.lang.String |
getUnicodeStringFromChar(char ch)
Returns a String containing the escaped
\\unnnn
representation for ch. |
static java.lang.String |
replaceAll(java.lang.String orig,
java.lang.String toBeReplaced,
java.lang.String replacement)
Replaces all occurrences of the given substring with the
given replacement string.
|
public static final java.lang.String lineSeparator
public static java.lang.String getEscapedStringOf(java.lang.String fromString)
'\\unnnn'. Used by SootClass to generate output.public static java.lang.String getQuotedStringOf(java.lang.String fromString)
public static java.lang.String getUnicodeStringFromChar(char ch)
\\unnnn
representation for ch.public static java.lang.String getUnEscapedStringOf(java.lang.String str)
\\unnnn
representation for any escaped characters in the string.public static char getCFormatChar(char c)
public static java.lang.String replaceAll(java.lang.String orig,
java.lang.String toBeReplaced,
java.lang.String replacement)
orig - The string in which all occurrences of the substring
are to be replaced.toBeReplaced - The substring which is to be replaced.replacment - The string which is to replace
toBeReplaced.String.
This method provides a facility similar to the String.replaceAll() method available in Java 1.4, except that it can only replace substrings rather than regular expressions. So if Soot ever abandons compatibility with pre-1.4 definitions of the Java API, it can also abandon replaceAllIn().
Copyright © 2012-2019 RoboVM AB. All Rights Reserved.