HPlogo System Debug Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 8 System Debug Standard Functions

func str

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

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

Feedback to webmaster