<< Home | About Forth | About TurboForth | Download | Language Reference | Resources | Tutorials | YouTube >>


Words in category Transient String Words in glossary String Library

Search:
The following words are listed in this category (28 words found): Word Types: S = Standard, I = Immediate , IC = Immediate-compiling.
Word Name Word Type Data Stack Signature Return Stack Signature Description Availability
V1.0 V1.1 V1.2
$'' IC tib:"string" -- -- Pushes a string to the string stack.
$.s S -- / ss: -- -- Displays a non-destructive dump of the string stack. Also reports the amount of string space allocated, the amount of string space in use, and the amount of string space remaining.
.$ S -- / ss: str -- -- Pops and displays the topmost string from the string stack.
+$ S -- / ss: s1 s2 -- s3 -- Concatenates strings s1 and s2, producing s3.
==$? S -- flag / ss: s1 s2 -- s1 s2 -- Performs a case-sensitive comparison of the topmost two strings on the string stack, returning true if their length and contents are identical, otherwise returning false. The strings are retained.
>$CONST S $Caddr -- / ss: str --  -- Moves the topmost string on the string stack to the specified string constant.
CMP$ S -- -1|0|+1  ss: -- -- Performs a case-sensitive comparison of the topmost two strings [s1, s2] on the string stack, returning -1 if s1 < s2, 0 if s1 = s2 or +1 if s1 > s2.
DEPTH$ S -- depth / ss: -- -- Pushes the current depth of the string stack to the data stack.
DROP$ S -- / ss: str -- -- Drops the topmost string from the string stack.
DUP$ S -- / ss: s1 -- s1 s1 -- Duplicates the topmost string on the string stack.
FIND$ S start -- pos|-1 / ss: s1 s2 -- s1 s2 -- Searches s1, starting from position start, for the first occurrence of the string s2. If the string is found, returns the position of the string relative to the offset, otherwise returns -1.
FINDC$ S char -- pos|-1 / ss: -- -- Searches the topmost string on the string stack for the ascii character char, returning its position, or -1 if not found. Note: the first character in the string is character #0.
LCASE$ S -- / ss: s1 -- s2 -- Converts all upper case characters in string s1 to lower case, resulting in string s2.
LEFT$ S len -- / ss: s1 s2 -- From string s1, creates a new string, s2, consisting of len characters from the left side of string s1.
LEN$ S -- len / ss: --  -- Pushes the length of the topmost string on the string stack to the data stack
LTRIM$ S -- / ss: s1 -- s2 -- Removes leading spaces from the left hand side of the topmost string on the string stack.
MID$ S start len -- / ss: s1 -- s1 s2 -- From string s1, produces a new string, s2, consisting of the characters of s1 from start to start+len.
NIP$ S -- / ss: s1 s2 -- s2 -- Removes the 2nd string from the string stack.
OVER$ S -- / ss: s1 s2 -- s1 s2 s1 -- Places a copy of the 2nd string on the string stack on the top of the string stack.
PICK$ S n -- / ss: -- s(n) -- Places a copy of string n to the top of the string stack. Allows the string stack to be indexed as an array.
REPLACE$ S -- pos / ss: s1 s2 s3 -- s4 -- In string s2 find s3 and replace with s1, resulting in s4. If a replacement is made, the starting position of the replacement is returned, otherwise -1 is returned.
 
RESET$ S -- / ss: -- -- The word RESET$ resets (empties) the string stack. All strings stored on the string stack are erased.
REV$ S -- / ss: s1 -- s2 -- Reverses the topmost string (s1) on the string stack, resulting in s2.
RIGHT$ S len -- / ss: s1 -- s1 s2 -- From string s1, creates a new string, s2, consisting of len characters from the right side of string s1.
RTRIM$ S -- / ss: s1 -- s2 -- Removes trailing spaces from the right side of the topmost string.
SWAP$ S -- / ss: s1 s2 -- s2 s1 -- Swaps the topmost two strings on the string stack.
TRIM$ S -- / ss: s1 -- s2 -- Removes leading and trailing spaces from the topmost string on the string stack.
UCASE$ S -- / ss: s1 -- s2 -- Converts all lowercase characters in string s1 to upper case, resulting in string s2.

<< Home | About Forth | About TurboForth | Download | Language Reference | Resources | Tutorials | YouTube >>