-
Effekt Library
- string
- substring
- substring
- isSubstringAt
- startsWith
- endsWith
- repeat
- padLeft
- padRight
- split
- join
- trim
- toBool
- toInt
- toInt
- unsafeToInt
- indexOf
- indexOf
- lastIndexOf
- lastIndexOf
- charAt
- unsafeCharAt
- string Jump to source: libraries/common/string.effekt
- substring
(str: String, from: Int, to: Int): String / {}
- substring
(str: String, from: Int): String / {}
- isSubstringAt
(str: String, prefix: String, from: Int): Bool / {}
- startsWith
(str: String, prefix: String): Bool / {}
- endsWith
(str: String, suffix: String): Bool / {}
- repeat
(str: String, n: Int): String / {}
- padLeft
(str: String, n: Int): String / {}
- padRight
(str: String, n: Int): String / {}
- split
(str: String, sep: String): List[String] / {}
- join
(strings: List[String], sep: String): String / {}
- trim
(str: String): String / {}
- toBool
(s: String): Bool / {Exception[WrongFormat]}
- toInt
(str: String): Int / {Exception[WrongFormat]}
- toInt
(str: String, base: Int): Int / {Exception[WrongFormat]}
- unsafeToInt
(str: String): Int / {}
- indexOf
(str: String, sub: String): Option[Int] / {}
- indexOf
(str: String, sub: String, from: Int): Option[Int] / {}
- lastIndexOf
(str: String, sub: String): Option[Int] / {}
- lastIndexOf
(str: String, sub: String, from: Int): Option[Int] / {}
- charAt
(str: String, index: Int): Char / {Exception[OutOfBounds]}
- unsafeCharAt
(str: String, n: Int): Char / {}
Example usage: examples/stdlib/string
Checks whether str starts with the given prefix at `from`
Repeats the given string n-times. TODO use a more efficient way of appending strings like a buffer
Left-pad the given string with spaces
Right-pad the given string with spaces
Native versions of toInt (unused right now)
Returns the index of the first occurrence of `sub` in `str`
Returns the index of the last occurence of `sub` in `str`