t

Any.Datum.String

trait _Trait[TYPE <: Any.Datum.String[TYPE]] extends Any.Datum.Comparable[TYPE, java.lang.String] with Custom.String._library._evaluate[TYPE] with Custom.String._library._modify[TYPE] with Custom.String._library._substring[TYPE] with Custom.String._library._transform[TYPE]

Ordering
  1. Alphabetic
Inherited
  1. String
  2. Custom.String._library._transform
  3. Custom.String._library._substring
  4. Any.Able.CopyRange
  5. Custom.String._library._modify
  6. Custom.String._library._evaluate
  7. Custom.String._library._evaluate._check
  8. Custom.String._library._evaluate._search
  9. Custom.String._library._evaluate._compare
  10. java.lang.Comparable
  11. Any.Datum.Comparable
  12. Any.Datum.Ref
  13. Any.Datum
  14. Any.Wrap
  15. scala.Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Method

  1. def allChars: ~[Char]

    Stream of Chars

    Stream of Chars

    Returns String as a Stream of [Char]]

    "abcd".allChars lp // Prints: ~(a, b, c, d)
    Definition Classes
    _transform
  2. def allIndexesOf(sub: scala.Predef.String, from: Opt.Int = \/): ~[scala.Int]

    Stream of indexes

    Stream of indexes

    Stream of indexes for each occurrence of real

    "abcd_abcd_abcd_abcd_abcd".allIndexesOf("bc") lp // Prints: ~(1, 6, 11, 16, 21)
    from

    position to start looking from

    Definition Classes
    _search
  3. def allLines: ~[scala.Predef.String]

    Stream of lines

    Stream of lines

    Creates a Stream of Strings representing lines (delimited by '\n') of this text

    "abc\n def\n xyz".allLines.lp // Prints: ~(abc,  def,  xyz)
    Definition Classes
    _transform
  4. def allSubstrings(size: scala.Int): ~[scala.Predef.String]

    Stream of substrings

    Stream of substrings

    Returns String as a Stream of substrings of given size

    Note: Last substring may be shorter

    ("abc" * 10) lp
    
    ("abc" * 10).allSubstrings(4) lp
    
    // Output
    abcabcabcabcabcabcabcabcabcabc
    ~(abca, bcab, cabc, abca, bcab, cabc, abca, bc)
    Definition Classes
    _transform
  5. def allTokenized(separators: ~[scala.Predef.String]): ~[(scala.Predef.String, Idx.Range, scala.Predef.String)]

    Stream of tokens

    Stream of tokens

    Multi token tokenizetion

    Returns a Tuple including:

    • Separator preceding the token, empty for the first token
    • Idx.Range of the token in the text
    • String token
    val str: String = (1 <> 40).all.format()
    "Text to Tokenize:".lp.lp
    str.lp.lp
    ("Token", "Range", "String").lp
    str.replaceAll("\n", "_").allTokenized("000" ~+ "111" + "222" + "333" + "444").tp
    
    // Output
    
    Text to Tokenize:
    
    12345678910111213141516171819202122232425262728293031323334353637383940
    
    (Token,Range,String)
    --- --------- -------------------
    ?   ?         ?
    --- --------- -------------------
        0 <>> 11  12345678910
    111 14 <>> 33 2131415161718192021
    222 36 <>> 55 3242526272829303132
    333 58 <>> 71 4353637383940
    --- --------- -------------------
    separators

    a Stream of text separators to consider

    Definition Classes
    _transform
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def charAt(i: scala.Int): Char

    Char at position

    Char at position

    Returns Char at the specified position

    Definition Classes
    _search
  8. def charAtOpt(i: scala.Int): Opt[Char]

    Char at position

    Char at position

    Optionally Returns Char at the specified position

    Opt.Void is returned if specified position is out of String range

    if(<name>.charAtOpt(2).let(_.isUpper)) App.Fail.toDo
    // is equivalent
    if(<name>.length >=2 && <name>.charAt(2).isUpper) App.Fail.toDo
    Definition Classes
    _search
  9. def charIndexOpt(f: (Char) ⇒ Boolean, from: Opt.Int = \/): Opt.Int

    Char index

    Char index

    Optionally returns index of the first Char passing the filter function

    "abcd_abcd_".charIndexOpt(_ >= 'd', 4) lp // Prints: Opt(8)
    "abcd_abcd_".charIndexOpt('x' <> 'z') lp  // Prints: Opt.Void
    from

    position to start looking from

    Definition Classes
    _search
  10. def compareTo(that: scala.Predef.String): scala.Int
    Definition Classes
    _compare → Comparable
  11. def contains(sub: scala.Predef.String): Boolean

    Contains check

    Contains check

    Returns true is this String contains that String

    "abc".contains("cd") lp // Prints: false
    Definition Classes
    _check
  12. def copy(r: Idx.Range): TYPE

    Copy range

    Copy range

    Copies elements within the range specified

    // Generic String example
    "abcdefghi".copy(3 <> 5).lp  // Prints: def
    Definition Classes
    _substringCopyRange
  13. def copyAfter(sub: scala.Predef.String, default: Opt[scala.Predef.String] = \/, from: Opt.Int = \/): TYPE

    Copy end

    Copy end

    Copies String from the position where the specified real found plus the length of the real

    If no real found, default real is returned, or original if default is void

    "abcdefg".copyAfter("cd") lp // Prints: efg
    Definition Classes
    _substring
  14. def copyAfterLast(sub: scala.Predef.String, default: Opt[scala.Predef.String] = \/, from: Opt.Int = \/): TYPE

    Copy end

    Copy end

    Copies String from the last position the specified real found plus the length of the real

    If no real found, default real is returned, or original if default is void.

    "abcd_abcd_abcd".copyFromLast("ab") lp // Prints: cd
    from

    string last position to start looking from end to start

    Definition Classes
    _substring
  15. def copyBefore(sub: scala.Predef.String, default: Opt[scala.Predef.String] = \/, from: Opt.Int = \/): TYPE

    Copy start

    Copy start

    Copies String from the beginning until specified real found

    If no real found, default real is returned, or original if default is void

    "abcdefg".copyBefore("ef") lp // Prints: abcd
    Definition Classes
    _substring
  16. def copyBeforeLast(sub: scala.Predef.String, default: Opt[scala.Predef.String] = \/, from: Opt.Int = \/): TYPE

    Copy start

    Copy start

    Copies String from the beginning until the last occurrence of specified real found

    If no real found, default real is returned, or original if default is void

    "abcd_abcd_abcd".copyBeforeLast("ab") lp // Prints: abcd_abcd_
    from

    string last position to start looking from end to start

    Definition Classes
    _substring
  17. def copyDrop(r: Idx.Range): TYPE

    Copy without range

    Copy without range

    Copies elements outside the range specified

    // Generic String example
    "abcdefghi".copyDrop(3 <> 5).lp  // Prints: abcghi
    Definition Classes
    _substringCopyRange
  18. def copyFirst(number: scala.Int): TYPE

    Copy start

    Copy start

    Copies specified number of first elements

    // Generic String example
    "abcdefghi".copyFirst(3).lp  // Prints: abc
    Definition Classes
    CopyRange
  19. def copyFrom(sub: scala.Predef.String, default: Opt[scala.Predef.String] = \/, from: Opt.Int = \/): TYPE

    Copy end

    Copy end

    Copies String from the position where the specified real found

    If no real found, default real is returned, or original if default is void

    "abcdefg".copyFrom("cd") lp // Prints: cdefg
    Definition Classes
    _substring
  20. def copyFrom(position: scala.Int): TYPE

    Copy end

    Copy end

    Copies elements from specified position to the end

    // Generic String example
    "abcdefghi".copyFrom(5).lp  // Prints: fghi
    Definition Classes
    CopyRange
  21. def copyFromLast(sub: scala.Predef.String, default: Opt[scala.Predef.String] = \/, from: Opt.Int = \/): TYPE

    Copy end

    Copy end

    Copies String from the last position the specified real found

    If no real found, default real is returned, or original if default is void.

    "abcd_abcd_abcd".copyromLast("ab") lp // Prints: abcd
    from

    string last position to start looking from end to start

    Definition Classes
    _substring
  22. def copyFull: TYPE

    Copy everything

    Copy everything

    Copies entire content

    Definition Classes
    CopyRange
  23. def copyLast(number: scala.Int): TYPE

    Copy end

    Copy end

    Copies specified number of elements at the end

    // Generic String example
    "abcdefghi".copyLast(3).lp  // Prints: ghi
    Definition Classes
    CopyRange
  24. def copyShort(cnt: scala.Int): TYPE

    Copy without end

    Copy without end

    Copies from the beginning, missing specified number of elements at the end

    // Generic String example
    "abcdefghi".copyShort(3).lp  // Prints: abcdef
    Definition Classes
    CopyRange
  25. def endsWith(sub: scala.Predef.String): Boolean

    Check if ends with

    Check if ends with

    Returns true this String ends with that String

    "abc".endsWith("bc") lp // Prints: true
    Definition Classes
    _check
  26. def equals(arg0: Any): Boolean
    Definition Classes
    Any
  27. def equalsIgnoreCase(v: scala.Predef.String): Boolean

    Check if equals ignore case

    Check if equals ignore case

    Returns true this and that String are equal, if upper and lower case Chars are considered equal

    "aBc".equalsIgnoreCase("ABC").lp // Prints: true
    Definition Classes
    _check
  28. def hashCode(): scala.Int
    Definition Classes
    Any
  29. def indent(tag: scala.Predef.String): scala.Predef.String

    Indents text with the tahStream of lines

    Indents text with the tahStream of lines

    Indents text with the tag.

    Prefixes first line with the tag, other lines with tag equal space

    "abc\nde\nxyz".indent("Lines: ").lp
    // Output
    Lines: abc
           de
           xyz
    Definition Classes
    _transform
  30. def indexOfOpt(sub: scala.Predef.String, from: Opt.Int = \/): Opt.Int

    Value position

    Value position

    Optionally returns position of the specified real

    "abcd_abcd_".indexOfOpt("d_a") lp // Prints: Opt(3)
    from

    position to start looking from

    Definition Classes
    _search
  31. def insertAt(i: scala.Int, v: scala.Predef.String): TYPE

    Insert at position

    Insert at position

    Creates new String with real inserted at the specified position

    "0123456789".insertAt(5,"abc") lp // Prints: 01234abc56789
    Definition Classes
    _modify
  32. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  33. def isLike(mask: scala.Predef.String, ignoreCase: Boolean = false): Boolean

    Check if pattern

    Check if pattern

    Returns true if this matches that pattern with '%' wild card

    "ABCD".isLike("AB%") lp  // Prints: true
    "ABCD".isLike("AC%") lp  // Prints: false
    ignoreCase

    if true upper and lower case Chars are considered equal

    Definition Classes
    _check
  34. def isVoid: Boolean
    Definition Classes
    _check
  35. def label: TYPE

    Capitalize

    Capitalize

    Capitalizes first character of every word (separated by white spaces)

    "all string ops".label lp // Prints: All String Ops
    Definition Classes
    _modify
  36. def lastCharIndexOpt(f: (Char) ⇒ Boolean, fromOpt: Opt.Int = \/): Opt.Int

    Char index

    Char index

    Optionally returns index of the last Char passing the filter function

    "abcd_abcd_".lastCharIndexOpt(_ >= 'd', 4) lp // Prints: Opt(3)
    "abcd_abcd_".lastCharIndexOpt('x' <> 'z') lp  // Prints: Opt.Void
    Definition Classes
    _search
  37. def lastIndexOfOpt(sub: scala.Predef.String, from: Opt.Int = \/): Opt.Int

    Value position

    Value position

    Optionally returns last position of the specified real

    "abcd_abcd_abcd_".lastIndexOfOpt("d_a") lp // Prints: Opt(8)
    from

    last position to start looking from end to start

    Definition Classes
    _search
  38. def lower: TYPE

    toLowerCase

    toLowerCase

    Creates new String with all upper case Chars changed to lower case

    "ABc".lower lp // Prints: abc
    Definition Classes
    _modify
  39. def make(v: java.lang.String): TYPE
    Attributes
    protected
    Definition Classes
    _Trait_Trait
  40. def padEndTo(targetLength: scala.Int, pad: scala.Predef.String = " "): TYPE

    Pad end

    Pad end

    Pads end of string to targetLength

    pad

    string to pad with.

    "ABC".padEndTo(10,"_") lp // Prints: ABC_______
    Definition Classes
    _modify
  41. def padStartTo(targetLength: scala.Int, pad: scala.Predef.String = " "): TYPE

    Pad start

    Pad start

    Pads start of string to targetLength

    pad

    string to pad with.

    "ABC".padStartTo(10,"_") lp // Prints: _______ABC
    Definition Classes
    _modify
  42. abstract def real: java.lang.String
    Attributes
    protected
    Definition Classes
    _Trait
  43. def remove(sub: scala.Predef.String): TYPE

    Remove all

    Remove all

    Creates new String with all occurrences of real removed

    "123123123123".remove("2") lp // Prints: 13131313
    Definition Classes
    _modify
  44. def replace(value: scala.Predef.String, target: scala.Predef.String): TYPE

    Replace all

    Replace all

    Creates new String with all occurrences of real replaced with target

    "123123123123".replace("2","_") lp // Prints: 1_31_31_31_3
    Definition Classes
    _modify
  45. def replace(r: Idx.Range, v: scala.Predef.String): TYPE

    Replace range with real

    Replace range with real

    Creates new String with all occurrences of real replaced with target

    "0123456789".replace(3 <> 7 ,"_") lp // Prints: 012_89
    Definition Classes
    _modify
  46. abstract def setup: String.Setup[TYPE]
    Attributes
    protected
    Definition Classes
    _Trait_Trait_Trait
  47. def size: scala.Int

    Container size

    Container size

    Notion of a range is only valid in presence of size

    Definition Classes
    _substringCopyRange
  48. def startsWith(sub: scala.Predef.String): Boolean

    Check if begins with

    Check if begins with

    Returns true this String starts with that String

    "abc".startsWith("ab") lp // Prints: true
    Definition Classes
    _check
  49. def toBooleanOut: Out[Boolean]

    Boolean outcome conversion

    Boolean outcome conversion

    Converts String to Boolean outcome

    "true".toBooleanOut lp
    
    "abc".toBooleanOut lp
    
    // Output
    Out(true)
    Out(failure=For input string: "abc")
    Definition Classes
    _transform
  50. def toDoubleOut: Out[scala.Double]

    Double outcome conversion

    Double outcome conversion

    Converts String to Double outcome

    "123.45".toDoubleOut lp
    
    "abc".toDoubleOut lp
    
    // Output
    Out(123.45)
    Out(failure=For input string: "abc")
    Definition Classes
    _transform
  51. def toIntOut: Out[scala.Int]

    Int outcome conversion

    Int outcome conversion

    Converts String to Int outcome

    "123".toIntOut lp
    
    "abc".toIntOut lp
    
    // Output
    Out(123)
    Out(failure=For input string: "abc")
    Definition Classes
    _transform
  52. def toLongOut: Out[scala.Long]

    Long outcome conversion

    Long outcome conversion

    Converts String to Long outcome

    "123".toLongOut lp
    
    "abc".toLongOut lp
    
    // Output
    Out(123)
    Out(failure=For input string: "abc")
    Definition Classes
    _transform
  53. def toString(): java.lang.String
    Definition Classes
    _Trait → Any
  54. def trim: TYPE

    Trim both ends

    Trim both ends

    Trims both ends of String from space Chars

    Definition Classes
    _modify
  55. def trimBoth(f: (Char) ⇒ Boolean): TYPE

    Trim both ends

    Trim both ends

    Trims both ends of String from Chars defined by filter function

    "yyzzxxABCzzyyxx".trimBoth('x' <> 'z') lp                // Prints: ABC
    
    "yyzzxxABCzzyyxx".trimBoth(c => c == 'x' || c == 'y') lp // Prints: zzxxABCzz
    Definition Classes
    _modify
  56. def trimEnd(f: (Char) ⇒ Boolean): TYPE

    Trim both ends

    Trim both ends

    Trims end of String from Chars defined by filter function

    "ABCzzyyxx".trimEnd('x' <> 'z') lp                // Prints: ABC
    
    "ABCzzyyxx".trimEnd(c => c == 'x' || c == 'y') lp // Prints: ABCzz
    Definition Classes
    _modify
  57. def trimEnd: TYPE

    Trim end

    Trim end

    Trims end of String from space Chars

    Definition Classes
    _modify
  58. def trimStart(f: (Char) ⇒ Boolean): TYPE

    Trim start

    Trim start

    Trims start of String from Chars defined by filter function

    "yyzzxxABC".trimBoth('x' <> 'z') lp                // Prints: ABC
    
    "yyzzxxABC".trimBoth(c => c == 'x' || c == 'y') lp // Prints: zzxxABC
    Definition Classes
    _modify
  59. def trimStart: TYPE

    Trim start

    Trim start

    Trims start of String from space Chars

    Definition Classes
    _modify
  60. def undo(v: TYPE): java.lang.String
    Definition Classes
    _Trait_modify
  61. def upper: TYPE

    toUpperCase

    toUpperCase

    Creates new String with all lower case Chars changed to upper case

    "aBc".upper lp // Prints: ABC
    Definition Classes
    _modify

Operator

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    Any
  2. final def ##(): scala.Int
    Definition Classes
    Any
  3. def +(v: Any): TYPE

    Plus

    Plus

    Creates a new instance with specified value added

    Definition Classes
    _modify
  4. def +-(v: Any): TYPE
    Definition Classes
    _modify
  5. def +~(v: ~[Any]): TYPE

    Plus all

    Plus all

    Creates a new instance with added stream values

    Definition Classes
    _modify
  6. final def ==(arg0: Any): Boolean
    Definition Classes
    Any
Linear Supertypes
Known Subclasses
Source: _Trait.scala