Language docs

String library

Reference for the character and string-printing words exported by the top-level `string` module.

This page lists the public words currently defined in the top-level string library module.

char.ffp

Source: ff/lib/string/char.ffp
Import: .import <string/char>

WordStack effectDescription
space-- 32Pushes the ASCII code for a space.
newline-- 10Pushes the ASCII code for a newline.
sp-- {prints char(32)}Prints a single space character.
cr-- {prints char(10)}Prints a newline character.
tab-- {prints char(9)}Prints a tab character.
lower?n -- flagTests whether a character code is lowercase ASCII.
upper?n -- flagTests whether a character code is uppercase ASCII.
ucasen -- n'Converts a lowercase ASCII character code to uppercase.
lcasen -- n'Converts an uppercase ASCII character code to lowercase.

str.ffp

Source: ff/lib/string/str.ffp
Import: .import <string/str>

WordStack effectDescription
prints0 n* -- {prints chars}Prints a null-terminated stack string.
println0 n* -- {prints chars, newline}Prints a stack string followed by a newline.
sprint[S] -- {prints string}Evaluates and prints a quoted string.
sprintln[S] -- {prints string, newline}Evaluates and prints a quoted string with a trailing newline.
slen[S] -- nReturns the length of a quoted string.
scat[A] [B] -- [A+B]Concatenates two quoted strings.
sjoin[A] [Sep] [B] -- [A Sep B]Joins two quoted strings with a separator.
cjoin[A] c [B] -- [A c B]Joins two quoted strings with a single character.