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


REPLACE$ Search:

In Transient String Words in String Library

Word Name: REPLACE$
Type: Standard word
Data Stack Signature: -- pos / ss: s1 s2 s3 -- s4
Return Stack Signature: --
Availability: V1.2
Description:

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.
 

Example:

None

Comment:

An error occurs if there are less than 3 strings on the string stack.

Note: If the replacement is made, s1, s2, and s3 are dropped from the string stack, and s4 is the new string.

If the replacement is not made, s1 and s2 remain on the string stack, and s3 is dropped.

See Also: FIND$ 

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