Packages

implicit final class RichString extends AnyVal

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RichString
  2. AnyVal
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new RichString(string: String)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    Any
  2. final def ##: Int
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def getClass(): Class[_ <: AnyVal]
    Definition Classes
    AnyVal → Any
  6. def getOrElse(default: => String): String

    Return the string unless it is null or empty, in which case return the default.

    Return the string unless it is null or empty, in which case return the default.

    default

    the string to return if inputString is null or empty

    returns

    either the inputString or the default

  7. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  8. def quoteC(): String

    Quote a string so that unprintable chars (in ASCII) are represented by C-style backslash expressions.

    Quote a string so that unprintable chars (in ASCII) are represented by C-style backslash expressions. For example, a raw linefeed will be translated into "\n". Control codes (anything below 0x20) and unprintables (anything above 0x7E) are turned into either "\xHH" or "\\uHHHH" expressions, depending on their range. Embedded backslashes and double-quotes are also quoted.

    returns

    a quoted string, suitable for ASCII display

  9. def regexSub(re: Regex)(replace: (MatchData) => String): String

    For every section of a string that matches a regular expression, call a function to determine a replacement (as in python's re.sub).

    For every section of a string that matches a regular expression, call a function to determine a replacement (as in python's re.sub). The function will be passed the Matcher object corresponding to the substring that matches the pattern, and that substring will be replaced by the function's result.

    For example, this call:

    "ohio".regexSub("""h.""".r) { m => "n" }

    will return the string "ono".

    The matches are found using Matcher.find() and so will obey all the normal java rules (the matches will not overlap, etc).

    re

    the regex pattern to replace

    replace

    a function that takes Regex.MatchData objects and returns a string to substitute

    returns

    the resulting string with replacements made

  10. val string: String
  11. def toCamelCase: String

    Converts foo_bar to fooBar (first letter lowercased)

    Converts foo_bar to fooBar (first letter lowercased)

    For example:

    "hello_world".toCamelCase

    will return the String "helloWorld".

  12. def toOption: Option[String]

    Wrap the string in an Option, returning None when it is null or empty.

  13. def toPascalCase: String

    Converts foo_bar to FooBar (first letter uppercased)

    Converts foo_bar to FooBar (first letter uppercased)

    For example:

    "hello_world".toPascalCase

    will return the String "HelloWorld".

  14. def toSnakeCase: String

    Converts FooBar to foo_bar (all lowercase)

    Converts FooBar to foo_bar (all lowercase)

    For example:

    "HelloWorld".toSnakeCase

    will return the String "hello_world".

  15. def toString(): String
    Definition Classes
    Any
  16. def unhexlify(): Array[Byte]

    Turn a string of hex digits into a byte array.

    Turn a string of hex digits into a byte array. This does the exact opposite of Array[Byte]#hexlify.

  17. def unquoteC(): String

    Unquote an ASCII string that has been quoted in a style like quoteC and convert it into a standard unicode string.

    Unquote an ASCII string that has been quoted in a style like quoteC and convert it into a standard unicode string. "\\uHHHH" and "\xHH" expressions are unpacked into unicode characters, as well as "\r", "\n", "\t", "\\", and '\"'.

    returns

    an unquoted unicode string

Inherited from AnyVal

Inherited from Any

Ungrouped