ru.makkarpov.scalingua

StringUtils

object StringUtils

Provides various string functions that are useful both in macros and in I18n code, such as string interpolations, escaping and unescaping.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. StringUtils
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. class InvalidInterpolationException extends IllegalArgumentException

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. val VariableCharacter: Char

    Interpolation placeholder character

  7. val VariableEscapeStr: String

  8. val VariableParentheses: (Char, Char)

    Opening and closing interpolation parentheses

  9. val VariableStartStr: String

  10. val VariableStr: String

  11. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  12. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  15. def escape(s: String, escapeUnicode: Boolean = true): String

    Converts all non-letter and non-printable characters in s to their escape codes.

    Converts all non-letter and non-printable characters in s to their escape codes.

    s

    Raw string to escape

    returns

    Escaped version of s

  16. def escapeInterpolation(s: String): String

    Escapes given interpolation string, replacing all occurences of '%' to '%%'

    Escapes given interpolation string, replacing all occurences of '%' to '%%'

    s

    Raw string

    returns

    Escaped string

  17. def extractVariables(msg: String): Set[String]

    Extracts all referred variables from string and returns a Set with names.

    Extracts all referred variables from string and returns a Set with names.

    msg

    Interpolation string

    returns

    Set of variable names referred in msg

  18. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  20. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  21. def interpolate[R](msg: String, args: (String, Any)*)(implicit format: OutputFormat[R]): R

    Replaces all occurences of placeholders like %(var) to corresponding variables in args with respect to specified OutputFormat (all placeholders will be escaped).

    Replaces all occurences of placeholders like %(var) to corresponding variables in args with respect to specified OutputFormat (all placeholders will be escaped). % can be escaped as %%. Note: for performance reasons this function will not use any Maps to index variables, it will use linear search every time it encounters a variable.

    R

    Result type

    msg

    Interpolation string

    args

    Interpolation variables

    format

    Desired OutputFormat summoned implicitly

    returns

    Interpolation result wrapped by OutputFormat

  22. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  23. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  24. final def notify(): Unit

    Definition Classes
    AnyRef
  25. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  26. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  27. def toString(): String

    Definition Classes
    AnyRef → Any
  28. def unescape(s: String): String

    Convert escape sequences like \\n to their meanings.

    Convert escape sequences like \\n to their meanings. Differs from StringContext.treatEscapes because latter does not handle \\uXXXX escape codes.

    s

    String with literal escape codes

    returns

    s having escape codes replaced with their meanings.

  29. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped