_transform

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

Def

@scala.annotation.targetName("char_Stream")
inline def char_~: ~

Source of Chars

Source of Chars

Returns String as a Source of [Char]] "abcd".char_~ tp // Prints ~(a, x, c, d)

Source
_transform.scala
inline def indent(inline tag: A | String): A

Indents text with the lines

Indents text with the lines

Indents text with the tag.

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

```
   "abc\

de
xyz".indent("Idxs: ").tp // Output Idxs: abc de xyz ```

Source
_transform.scala
@scala.annotation.targetName("line_Stream")
inline def line_~: ~[A]

Source of lines

Source of lines

Creates a [[Source]] of Strings representing lines (delimited by '

') of this text

```  "abc\

def
xyz".line_~.tp // Prints ~(abc, def, xyz) ```

Source
_transform.scala
@scala.annotation.targetName("nonEmpty_Opt")
inline def nonEmpty_?: Opt[A]
@scala.annotation.targetName("split_Stream")
inline def split_~(inline separator: Char): ~[A]
@scala.annotation.targetName("split_Stream")
inline def split_~(inline separators: Array[Char]): ~[A]
@scala.annotation.targetName("toBoolean_Opt")
@scala.annotation.targetName("toBoolean_Result")
inline def toBoolean_??: Result[Boolean]

Boolean result conversion

Boolean result conversion

Converts String to Boolean result

 "true".toBoolean_?? tp

 "abc".toBoolean_?? tp

 // Output
 Result(true)
 Result(failure=For input string: "abc")
Source
_transform.scala
@scala.annotation.targetName("toDouble_Opt")
@scala.annotation.targetName("toDouble_Result")
inline def toDouble_??: Result[Double]

Double result conversion

Double result conversion

Converts String to Double result

 "123.45".toDouble_?? tp

 "abc".toDouble_?? tp

 // Output
 Result(123.45)
 Result(failure=For input string: "abc")
Source
_transform.scala
@scala.annotation.targetName("toInt_Opt")
inline def toInt_?: Int.Opt
@scala.annotation.targetName("toInt_Result")
inline def toInt_??: Result[Int]

Int result conversion

Int result conversion

Converts String to Int result

 "123".toInt_?? tp

 "abc".toInt_?? tp

 // Output
 Result(123)
 Result(failure=For input string: "abc")
Source
_transform.scala
@scala.annotation.targetName("tokenized_Stream")
inline def tokenized_~(inline separators: ~[A]): ~[(A, Int.<>, A)]

Source of tokens

Source of tokens

Multi token tokenizetion

Returns a Tuple including:

  • Separator preceding the token, empty for the first token
  • !.Range of the token in the text
  • String token
  val str: String = (1 <> 40).~.makeString()
  "Text to Tokenize:".tp.tp
  str.tp.tp
  ("Token", "Range", "String").tp
  str.tokenized_~(~~("000","111","222","333","444")).print

  // Output

  Text to Tokenize:

  12345678910111213141516171819202122232425262728293031323334353637383940

  (Token,Range,String)
  --- --------- -------------------
  ?   ?         ?
  --- --------- -------------------
       0 <>> 11 12345678910
  111 14 <>> 33 2131415161718192021
  222 36 <>> 55 3242526272829303132
  333 58 <>> 71 4353637383940
  --- --------- -------------------
Value Params
separators

a Source of text separators to consider

Source
_transform.scala
@scala.annotation.targetName("toLong_Opt")
inline def toLong_?: Long.Opt
@scala.annotation.targetName("toLong_Result")
inline def toLong_??: Result[Long]

Long result conversion

Long result conversion

Converts String to Long result

  "123".toLong_?? tp

  "abc".toLong_?? tp

  // Output
  Result(123)
  Result(failure=For input string: "abc")
Source
_transform.scala