Class

com.twitter.conversions.StringOps

RichString

Related Doc: package StringOps

Permalink

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

Instance Constructors

  1. new RichString(string: String)

    Permalink

Value Members

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

    Permalink
    Definition Classes
    Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def getClass(): Class[_ <: AnyVal]

    Permalink
    Definition Classes
    AnyVal → Any
  6. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  7. def quoteC(): String

    Permalink

    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

  8. def regexSub(re: Regex)(replace: (MatchData) ⇒ String): String

    Permalink

    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

  9. val string: String

    Permalink
  10. def toCamelCase: String

    Permalink

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

  11. def toPascalCase: String

    Permalink

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

  12. def toSnakeCase: String

    Permalink

    Converts FooBar to foo_bar (all lowercase)

    Converts FooBar to foo_bar (all lowercase)

    For example:

    "HelloWorld".toSnakeCase

    will return the String "hello_world".

  13. def toString(): String

    Permalink
    Definition Classes
    Any
  14. def unhexlify(): Array[Byte]

    Permalink

    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.

  15. def unquoteC(): String

    Permalink

    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