str - Character string
Module Description
The str module implements a dynamic text string.
Module Words
String structure
str%
( - n )
Get the required space for the str data structure
String creation, initialisation and destruction
str-init
( w:str - )
Initialise the empty string
str-create
( C: "name" - R: - w:str )
Create a named string in the dictionary
str-new
( - w:str )
Create a new string on the heap
str-free
( w:str - )
Free the string from the heap
Member words
str-empty?
( w:str - f )
Check for an empty string
str-length@
( w:str - u )
Get the length of the string
str-index?
( n w:str - f )
Check if an index is valid in the string
str-size!
( u w:str - )
Insure the size of the string
str-extra@
( w:str - u )
Get the extra space allocated during resizing of the string
str-extra!
( u w:str - )
Set the extra space allocated during resizing of the string
str+extra@
( - u )
Get the initial extra space allocated during resizing of the string
str+extra!
( u - )
Set the initial extra space allocated during resizing of the string
Set words
str-clear
( w:str - )
Clear the string
str-set
( c-addr u w:str - )
Set a string in the string
str-append-string
( c-addr u w:str - )
Append a string to the string
str-prepend-string
( c-addr u w:str - )
Prepend a string to the string
str-append-chars
( c u w:str - )
Append a number of characters
str-prepend-chars
( c u w:str - )
Prepend a number of characters
str-insert-string
( c-addr u n:start w:str - )
Insert a string in the string
str-insert-chars
( c u n:start w:str - )
Insert a number of characters
Get words
str-get-substring
( u n:start w:str - c-addr u )
Get a substring from start, u chars long
str-get
( w:str - c-addr u )
Get the string
str-bounds
( w:str - c-addr+u c-addr )
Get the bounds of the string
Delete word
str-delete
( u n w:str - )
Delete a substring from nth index and length u from the string
Zero terminated string words
str-set-zstring
( c-addr w:str - )
Set a zero terminated string in the string
str-get-zstring
( w:str - c-addr )
Get the string as zero terminated string
Strings word
Character words
str-append-char
( c w:str - )
Append a character at the end of the string
str-prepend-char
( c w:str - )
Prepend a character at the start of the string
str-push-char
( c w:str - )
Push a character at the end of the string
str-pop-char
( w:str - c )
Pop a character from the end of the string
str-enqueue-char
( c w:str - )
Place a character at the start of the string
str-dequeue-char
( c w:str - )
Get the character at the end of the string
str-set-char
( c n w:str - )
Set the character on the nth position in the string
str-get-char
( n w:str - c )
Get the character from the nth position in the string
str-insert-char
( c n w:str - )
Insert the character on the nth position in the string
str-delete-char
( n w:str - )
Delete the character on the nth position in the string
Special words
str-count
( c-addr u w:str - u )
Count the number of occurences of a string in the string
str-execute
( ... xt w:str - ... )
Execute the xt token for every character in the string
Special manipulation words
str-capatilize
( w:str - )
Capatilize the first word in the string
str-cap-words
( w:str - )
Capatilize all words in the string
str-center
( u w:str - )
Center the string in u width
str-align-left
( u w:str - )
Align left the string in u width
str-align-right
( u w:str - )
Align right the string in u width
str-strip-leading
( w:str - )
Strip leading spaces in the string
str-strip-trailing
( w:str - )
Strip trailing spaces in the string
str-strip
( w:str - )
Strip leading and trailing spaces in the string
str-lower
( w:str - )
Convert the string to lower case
str-upper
( w:str - )
Convert the string to upper case
str-expand-tabs
( u w:str - )
Expand the tabs to u spaces in the string
Comparison words
icompare
( c-addr u c-addr u - n )
Compare case-insensitive two strings
str-icompare
( c-addr u w:str - n )
Compare case-insensitive a string with the string
str-ccompare
( c-addr u w:str - n )
Compare case-sensitive a string with the string
str^icompare
( w:str w:str - n )
Compare case-insensitive two strings
str^ccompare
( w:str w:str - n )
Compare case-sensitive two strings
Search and replace words
str-find
( c-addr u n w:str - n )
Find the first occurence of a string from nth position in the string
str-replace
( c-addr u c-addr u w:str - )
Replace the occurences of the second string with the first string in the string
Inspection
str-dump
( w:str - )
Dump the string
generated 09-Jan-2007 by
ofcfrth-0.2.0