|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object soot.util.StringTools
public class StringTools
Utility methods for string manipulations commonly used in Soot.
Field Summary | |
---|---|
static String |
lineSeparator
Convenience field storing the system line separator. |
Constructor Summary | |
---|---|
StringTools()
|
Method Summary | |
---|---|
static char |
getCFormatChar(char c)
Returns the canonical C-string representation of c. |
static String |
getEscapedStringOf(String fromString)
Returns fromString, but with non-isalpha() characters printed as '\\unnnn' . |
static String |
getQuotedStringOf(String fromString)
Returns fromString, but with certain characters printed as if they were in a Java string literal. |
static String |
getUnEscapedStringOf(String str)
Returns a String de-escaping the \\unnnn
representation for any escaped characters in the string. |
static String |
getUnicodeStringFromChar(char ch)
Returns a String containing the escaped \\unnnn
representation for ch . |
static String |
replaceAll(String orig,
String toBeReplaced,
String replacement)
Replaces all occurrences of the given substring with the given replacement string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String lineSeparator
Constructor Detail |
---|
public StringTools()
Method Detail |
---|
public static String getEscapedStringOf(String fromString)
'\\unnnn'
. Used by SootClass to generate output.
public static String getQuotedStringOf(String fromString)
public static String getUnicodeStringFromChar(char ch)
\\unnnn
representation for ch
.
public static String getUnEscapedStringOf(String str)
\\unnnn
representation for any escaped characters in the string.
public static char getCFormatChar(char c)
public static String replaceAll(String orig, String toBeReplaced, 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().
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |