Expand description
Additional string manipulation helpers. Additional Pan string utilities.
Functionsยง
- applescriptstring
- Escapes a string to use as an AppleScript string literal.
- batchreplace
- Performs replacements based on a separator-delimited mapping table.
- connect
- Concatenates
prefixandsuffixwithconnectorwhen both exist. - crtovtab
- Replaces carriage returns with vertical tabs.
- defaulttext
- Returns
defaultwhentextis empty. - extract
- Extracts the
item-th element from an array. - fixedwidth
- Pads or truncates
textto exactlywidthcharacters. - fixedwidthright
- Right-aligns
texttowidth, truncating from the left if needed. - linestrip
- Removes empty lines and normalizes line breaks to
\n. - lower
- Converts all characters to lowercase.
- obscuredigits
- Replaces all but the last
keep_lastdigits withX. - onespace
- Collapses runs of spaces into a single space and trims ends.
- onewhitespace
- Collapses runs of whitespace into a single space and trims ends.
- padzero
- quoted
- Wraps text in double quotes, doubling any internal quotes.
- randomletter
- Returns a random ASCII letter.
- randomline
- Returns a random non-empty line from
text. - randomword
- Returns a random whitespace-delimited word from
wordlist. - rep
- Repeats
textcounttimes. - replace
- Replaces all occurrences of
searchwithreplace_with. - replacemultiple
- Replaces multiple search strings with their corresponding replacements.
- sandwich
- Wraps
rootwithprefixandsuffixwhenrootis non-empty. - strip
- Trims whitespace and control characters from both ends.
- stripchar
- Keeps only characters within the inclusive
rangepairs. - striphtmltags
- Removes simple HTML tags delimited by
<and>. - stripprintable
- Removes non-printable ASCII control characters.
- striptoalpha
- Keeps only alphabetic characters.
- striptonum
- Keeps only ASCII digits.
- upper
- Converts all characters to uppercase.
- upperword
- Uppercases the first character of each whitespace-delimited word.
- vtabtocr
- Replaces vertical tabs with carriage returns.
- yoke
- Like
connect, but with different parameter naming.