Class StringTools

java.lang.Object
sootup.core.util.StringTools

public class StringTools extends Object
Utility methods for string manipulations commonly used in sootup.
  • Field Details

    • lineSeparator

      public static final String lineSeparator
      Convenience field storing the system line separator.
  • Constructor Details

    • StringTools

      public StringTools()
  • Method Details

    • getEscapedStringOf

      public static String getEscapedStringOf(String fromString)
      Returns fromString, but with non-isalpha() characters printed as '\\unnnn'.
    • getQuotedStringOf

      public static String getQuotedStringOf(String fromString, boolean needsQuotes)
      Returns fromString, but with certain characters printed as if they were in a Java string literal. Used by StringConstant.toString()
    • getUnicodeStringFromChar

      public static String getUnicodeStringFromChar(char ch)
      Returns a String containing the escaped \\unnnn representation for ch .
    • getUnEscapedStringOf

      public static String getUnEscapedStringOf(String str)
      Returns a String de-escaping the \\unnnn representation for any escaped characters in the string.
    • getCFormatChar

      public static char getCFormatChar(char c)
      Returns the canonical C-string representation of c.