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 VariableParentheses: (Char, Char)

    Opening and closing interpolation parentheses

  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def clone(): AnyRef

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

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

    Definition Classes
    AnyRef → Any
  12. def escape(s: String): 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

  13. 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

  14. def finalize(): Unit

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

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

    Definition Classes
    AnyRef → Any
  17. 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

  18. final def isInstanceOf[T0]: Boolean

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

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

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

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

    Definition Classes
    AnyRef
  23. def toString(): String

    Definition Classes
    AnyRef → Any
  24. 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.

  25. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped