Expand description
String manipulation helpers. Pan string formatting and slicing helpers.
Modules§
- funnel
- Funnel-style substring extraction helpers. Funnel-style substring extraction.
- numeric
- Numeric string helpers. Pan numeric string helpers.
- pattern
- Numeric formatting with Pan pattern syntax. Pan numeric pattern formatting.
- stringmod
- Additional string manipulation helpers. Additional Pan string utilities.
Functions§
- after
- Returns the substring after the first occurrence of
tag. - before
- cat
- Concatenates two strings.
- contains
- Returns true if
substringis present intext. - firstline
- Returns the first line split by
\n. - lastline
- Returns the last line split by
\n. - lastword
- Returns the last whitespace-delimited word.
- left
- Returns the leftmost
lencharacters. - length
- Returns the number of Unicode scalar values in
text. - linecount
- Returns the number of
\n-delimited lines. - mid
- Returns
lencharacters starting at the 1-basedstartposition. - nthline
- Returns the 1-based line number
num, or empty if missing. - nthword
- Returns the 1-based word number
num, or empty if missing. - rangecontains
- Returns true if any character is within the range pairs.
For instance, “
AZaz” means ‘A’..=‘Z’ and ‘a’..=‘z’. - rangematch
- Returns true if every character is within the range pairs.
For instance, “
AZaz” means ‘A’..=‘Z’ and ‘a’..=‘z’. - removeprefix
- Removes
prefixwhen present. - removesuffix
- Removes
suffixwhen present. - rep
- Repeats
textcounttimes. - right
- Returns the rightmost
lencharacters. - sandwich
- Wraps
rootwithprefixandsuffixwhenrootis non-empty. For example: a, b, c -> “abc”; a, “”, c -> “”. - search
- Returns the 1-based character index of
phrase, or 0 if missing. - snip
- Removes a slice starting at the 0-based
startposition. - textafter
- Returns the substring after
tag, ortextwhen not found. - textbefore
- trim
- Removes
lencharacters from the end oftext. - trimleft
- Removes
lencharacters from the start oftext. - wordcount
- Returns the number of whitespace-delimited words.