mud/lib/doc/sefun/arrange_string
2020-09-06 05:43:07 -07:00

42 lines
1.2 KiB
Plaintext

ARRANGE_STRING(1) ARRANGE_STRING(1)
NAME
arrange_string() - arranges a string to a given length
SYNOPSIS
string arrange_string(string str, int x)
DESCRIPTION
Passed a string and a length, this function returns the
original string either cut to or extended to the length
specified by the second argument. If the length of the
original string is longer than the length specified, then
all characters beyond the length specified are cut off.
If the length is less than the original string's length,
then the original string is padded with spaces so that it
ends up being as long as the length specified.
EXAMPLES
o arrange_string("resistence is futile", 25) returns
"resistence is futile "
o arrange_string("gurble", 2) returns "gu"
NOTES
Do not use this function inside the mudlib, as it is slow.
Instead use sprintf(). This sefun exists to make life
easy on creators.
LOCATION
/secure/sefun/strings.c
SEE ALSO
center(), wrap()
Author
Descartes of Borg
1