Name
MidStr -- extract characters from a string
Synopsis
var$ = MidStr(string$, startpos[, len, encoding])
Function
Returns len characters from string$ (starting at position startpos) as a new string. The starting position startpos needs to be specified in characters, not in bytes.

Starting with Hollywood 6.1 len may be omitted or set to -1. In that case, the remaining characters in string$ will be returned.

The optional encoding parameter can be used to set the character encoding to use. This defaults to the default string encoding set using SetDefaultEncoding(). See Character encodings for details.

Inputs
string$
source string
startpos
starting offset in characters (first character is at position 0)
len
optional: how many characters shall be returned; if you omit this argument or set it to -1, all remaining characters will be returned
encoding
optional: character encoding to use (defaults to default string encoding) (V7.0)
Results
var$
resulting string
Example
test$ = MidStr("Hello World!", 4, 3)
Print(test$)
This will print "o W" to the screen.

Show TOC