~/bend-docscommunity

shared/strings.bend checks

raw source on the hub · import bend-lint-api@0.2.0.0/shared/strings.bend as Strings

1 import
import Base

Definitions

def take.go source · line 3 · raw

@n:Nat -> @s:String -> @acc:String -> String

def take source · line 11 · raw

@s:String -> @n:Nat -> String

The first n characters of s. Base's String.take is not tail-recursive, so long text would overflow the stack.

def slice source · line 15 · raw

@text:String -> @+beg:U32 -> @end:U32 -> String

The text of text from beg to end, in code points.

def line_start.go source · line 18 · raw

@s:String -> @+i:U32 -> @+at:U32 -> @start:U32 -> @going:Bool -> U32

def line_start source · line 34 · raw

@text:String -> @+at:U32 -> U32

Where the line of text that holds the offset at starts: after the last newline before it.

def line_end.go source · line 37 · raw

@s:String -> @i:U32 -> U32

def line_end source · line 47 · raw

@text:String -> @+beg:U32 -> U32

Where the line of text that starts at beg ends: after its newline, or at the end of the text.

def starts_with source · line 50 · raw

@s:String -> @c:Char -> Bool

def before.go source · line 57 · raw

@s:String -> @+sep:Char -> @acc:String -> @at:Bool -> String

def before source · line 67 · raw

@+s:String -> @+sep:Char -> String

What comes before the first sep of s, or "" if there is none.

def after_last.go source · line 70 · raw

@s:String -> @+sep:Char -> @seg:String -> String

def after_last source · line 78 · raw

@s:String -> @sep:Char -> String

What comes after the last sep of s, or all of s if there is none.

def onto source · line 82 · raw

@chunks:List<&2, String> -> @out:String -> String

The chunks of chunks (last first) as one text, before out. Each chunk is copied once, so it is linear.