_modify

trait _modify[A <: String | Opaque.String]
class java.lang.Object
trait scala.Matchable
class Any

Def

@scala.annotation.targetName("_join")
inline def +(inline v: A | String): A
@scala.annotation.targetName("_joinAll")
inline def ++(inline v: ~[A | String]): A
inline def insertAt(inline i: Int, inline v: A | String): A

Insert at position

Insert at position

Creates new String with x inserted at the specified position "0123456789".insertAt(5,"abc") tp // Prints: 01234abc56789

Source
_modify.scala
def join(v: A | String): A
inline def joinAll(inline v: ~[A | String]): A
inline def label: A

Capitalize

Capitalize

Capitalizes first character of every word (separated by white spaces) "all string ops".label tp // Prints: All String Ops

Source
_modify.scala
inline def lower: A

toLowerCase

toLowerCase

Creates new String with all upper case Chars changed to lower case "ABc".lower tp // Prints: abc

Source
_modify.scala
inline def padEndTo(inline sz: Int, inline pad: String): A

Pad end

Pad end

Pads end of string to targetLength

Value Params
pad

string to pad with. "ABC".padEndTo(10,"_") tp // Prints: ABC_______

Source
_modify.scala
inline def padStartTo(inline sz: Int, inline pad: String): A

Pad start

Pad start

Pads start of string to targetLength

Value Params
pad

string to pad with. "ABC".padStartTo(10,"_") tp // Prints: _______ABC

Source
_modify.scala
inline def remove(inline v: A | String): A

Remove all

Remove all

Creates new String with all occurrences of x removed "123123123123".remove("2") tp // Prints: 13131313

Source
_modify.scala
inline def replace(inline r: Int.<>, inline v: A | String): A

Replace range with x

Replace range with x

Creates new String with all occurrences of x replaced with target "0123456789".replace(3 <> 7 ,"_") tp // Prints: 012_89

Source
_modify.scala
inline def replace(inline v: A | String, inline target: A | String): A

Replace all

Replace all

Creates new String with all occurrences of x replaced with target "123123123123".replace("2","_") tp // Prints: 1_31_31_31_3

Source
_modify.scala
inline def replaceFirst(inline v: A | String, inline v2: A | String, inline cnt: Int): A
inline def replaceLast(inline v: A | String, inline v2: A | String, inline cnt: Int): A
inline def trim: A

Trim both ends

Trim both ends

Trims both ends of String from space Chars

Source
_modify.scala
inline def trimBoth(inline f: Char => Boolean): A

Trim both ends

Trim both ends

Trims both ends of String from Chars defined by let function

   "yyxxxxABCxxyyxx".trimBoth(_ in 'x' <> 'z') tp           // Prints: ABC

   "yyxxxxABCxxyyxx".trimBoth(c => c == 'x' || c == 'y') tp // Prints: ABC
Source
_modify.scala
inline def trimEnd: A

Trim end

Trim end

Trims end of String from space Chars

Source
_modify.scala
inline def trimEnd(inline f: Char => Boolean): A

Trim both ends

Trim both ends

Trims end of String from Chars defined by let function

   "ABCxxyyxx".trimEnd(_ in 'x' <> 'z') tp           // Prints: ABC

   "ABCxxyyxx".trimEnd(c => c == 'x' || c == 'y') tp // Prints: ABC
Source
_modify.scala
inline def trimStart: A

Trim start

Trim start

Trims start of String from space Chars

Source
_modify.scala
inline def trimStart(inline f: Char => Boolean): A

Trim start

Trim start

Trims start of String from Chars defined by let function

   "yyxxxxABC".trimStart(_ in 'x' <> 'z') tp           // Prints: ABC

   "yyxxxxABC".trimStart(c => c == 'x' || c == 'y') tp // Prints: ABC
Source
_modify.scala
inline def upper: A

toUpperCase

toUpperCase

Creates new String with all lower case Chars changed to upper case "aBc".upper tp // Prints: ABC

Source
_modify.scala