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


MID$ Search:

In Transient String Words in String Library

Word Name: MID$
Type: Standard word
Data Stack Signature: start len -- / ss: s1 -- s1 s2
Return Stack Signature: --
Availability: V1.2
Description:

From string s1, produces a new string, s2, consisting of the characters of s1 from start to start+len.

Example:

$"redgreenblue" 3 5 mid$ $. \ displays "green"

Comment:

The first character in the string is character number 0.

An error will occur under the following conditions:

  • The string stack is empty;
  • Start is outside the size of the string;
  • End is outside the size of the string.
See Also: LEFT$  RIGHT$ 

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