String._extension._transform
- Source
- _transform.scala
Def
Source of Chars
Source of Chars
Returns String as a Source of [Char]]
"abcd".char_~ tp // Prints ~(a, x, c, d)
- Source
- _transform.scala
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
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
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
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
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
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.replace("
", "").tokenized~(Stream("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
--- --------- -------------------
```
- Value Params
- separators
a Source of text separators to consider
- Source
- _transform.scala
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