_transform

trait _transform
class java.lang.Object
trait scala.Matchable
class Any

Def

Stream of Chars

Stream of Chars

Returns String as a Stream of [Char]]

"abcd".charStream.tp // Prints Stream(a, x, c, d)
Source
_transform.scala
inline def indent(tag: String): String

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
inline def lineStream: Stream[String]

Stream of lines

Stream of lines

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

') of this text

```
"abc\

def
xyz".lineStream.tp // Prints Stream(abc, def, xyz) ```

Source
_transform.scala
inline def splitStream(sep: Char, more: Char*): Stream[String]

Boolean option conversion

Boolean option conversion

Converts String to Boolean option

 "true".toBooleanOpt.tp

 "abc".toBooleanOpt.tp

 // Output
 Boolean.Opt(true)
 Boolean.Opt(VOID)
Source
_transform.scala
inline def toBooleanResult: Result[Boolean]

Boolean result conversion

Boolean result conversion

Converts String to Boolean result

 "true".toBooleanResult.tp

 "abc".toBooleanResult.tp

 // Output
 Result(true)
 Result(Problem(For input string: "abc"))
Source
_transform.scala

Double option conversion

Double option conversion

Converts String to Double option

 "123.45".toDoubleOpt.tp

 "abc".toDoubleOpt.tp

 // Output
 Double.Opt(123.45)
 Double.Opt(VOID)
Source
_transform.scala
inline def toDoubleResult: Result[Double]

Double result conversion

Double result conversion

Converts String to Double result

 "123.45".toDoubleResult.tp

 "abc".toDoubleResult.tp

 // Output
 Result(123.45)
 Result(Problem(For input string: "abc"))
Source
_transform.scala
inline def toIntOpt: Int.Opt

Int opt conversion

Int opt conversion

Converts String to Int option

 "123".toIntOpt.tp

 "abc".toIntOpt.tp

 // Output
 Int.Opt(123)
 Int.Opt(VOID)
Source
_transform.scala
inline def toIntResult: Result[Int]

Int result conversion

Int result conversion

Converts String to Int result

 "123".toIntResult.tp

 "abc".toIntResult.tp

 // Output
 Result(123)
 Result(Problem(For input string: "abc"))
Source
_transform.scala
inline def tokenizedStream(separators: Stream[String]): Stream[(String, Int.Range, String)]

Stream of tokens

Stream 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).stream.makeString("")
  "Text to Tokenize:".tp.tp
  str.tp.tp
  ("Token", "Range", "String").tp
  str.tokenizedStream(Stream("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 Stream of text separators to consider

Source
_transform.scala
inline def toLongOpt: Long.Opt

Long option conversion

Long option conversion

Converts String to Long option

  "123".toLongOpt.tp

  "abc".toLongOpt.tp

  // Output
  Long.Opt(123)
  Long.Opt(VOID)
Source
_transform.scala
inline def toLongResult: Result[Long]

Long result conversion

Long result conversion

Converts String to Long result

  "123".toLongResult.tp

  "abc".toLongResult.tp

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

Make

To Problem

To Problem

Creates Result.Problem, where the base String becomes problem message

Source
_transform.scala