HPlogo System Debug Reference Manual > Chapter 10 System Debug Standard Functions

func str

MPE documents

Complete PDF
Table of Contents
Index

E0201 Edition 4 ♥
E0300 Edition 3
E0692 Edition 3

Returns a substring of a source string.

Syntax



   str (source position length)

Formal Declaration



   str:str (source:str position:u16 length:u16)

Parameters


source

The string from which to extract the substring.

position

The index of the first character to extract. String indices are 1-based. (That is, indices are 1, 2, 3, ... rather than 0, 1, 2, ...)

length

The number of characters to extract. If this value is larger than the actual number of characters in the string, the string is returned from the starting position to the end without an error indication.

Examples



   $nmdebug > = str("I am sincere.", 6, 3)
   "sin"

Starting at position 6, extract the next three characters.

 $nmdebug > = str("Hello mom! I don't know how long this is", 7, 1000)
 "mom! I don't know how long this is"

Extract the remainder of the string starting at position 7.

Limitations, Restrictions


none




func stolog


func strapp