"STRN" String functionsΒΆ

Fingerprint ID:0x5354524e

This fingerprint, from RC/Funge-98, implements operations on null-terminated string (“0gnirts”). It provides the following commands:

A : as bsstrs
Append b to a.
C : bs asn
Pushes -1 if a is lexicographically less than b, 1 if greater than, and 0 otherwise.
D : strs
Prints the string.
F : needles haystacksstrs
Pushes the longest suffix of haystack starting with needle. Pushes null string (i.e. one zero) if needle is not in haystack.
G : posvstrs
Gets the string from given position. It scans Funge space rightwards, from pos to first zero cell (as done by P command). Reflects if no zero cell found.
I : strs
Reads the string from standard input, discarding the trailing newline. Reflects at EOF.
L : strs nstrs
Pushes leftmost (at most) n characters of str. Reflects if n is negative.
M : strs s nstrs
Pushes the substring of str starting at offset s ending at offset s+n. The offset is 0 at the first character. If the ending offset is past the end of string, pushes less than n characters. Reflects if n is negative or the starting offset is out of bound.
N : strs nstrs
Pushes the length of string, except trailing zero. Retains the original string.
P : strs posv
Puts the string to given position. It writes each characters of str rightwards, and writes zero cell at the end.
R : strs nstrs
Pushes rightmost (at most) n characters of str. Reflects if n is negative.
S : nstrs
Pushes the string representation of n.
V : strsn
Parses the string representation of number. It works like atoi(3) call, but reflects for invalid input.

Previous topic

"SOCK" TCP/IP socket extension

Next topic

"SUBR" Subroutine extension

This Page

Quick search