My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
SUBSTR  
Updated Jan 21, 2009 by apangb...@gmail.com

Substring instruction

Stack Address Description
$STACK The original string
$STACK-1 The starting index
$STACK-2 The ending index

The character at the ending index is NOT included. Indices are 0-based (index 0 is the first character of the string, not index 1)

Example:
load #3               
load #0
load "foobar"
substr
The result put onto the stack is "foo"
If the ending index is specified as 0, this means goto the end of the string Example:
load #0
load #3
load "foobar"
substr
The result put onto the stack is "bar"
Powered by Google Project Hosting