beautypg.com

HP Prime Graphing Wireless Calculator User Manual

Page 280

background image

276

Programming in HP PPL

Returns the last n characters of string str. If n <= 0, returns
empty string. If n > DIM(str), returns str
Example: RIGHT("MOMOGUMBO",5) returns

"GUMBO"

MID

Syntax: MID(str,pos, [n])
Extracts n characters from string str starting at index pos.
n is optional, if not specified, extracts all the remainder of
the string.
Example: MID("MOMOGUMBO",3,5) returns

"MOGUM", MID("PUDGE",4) returns "GE"

ROTATE

Syntax: ROTATE(str,n)
Permutation of characters in string str. If 0 <=n < DIM(str),
shifts n places to left. If DIM(str) < n <= –1, shifts n spaces
to right. If n > DIM(str) or n < DIM(str), returns str.
Examples:

ROTATE("12345",2) returns "34512"
ROTATE("12345",-1) returns "51234"
ROTATE("12345",6) returns "12345"

STRINGFROMID

Syntax: STRINGFROMID(integer)
Returns, in the current language, the built-in string

associated in the internal string table with the specified

integer.
Examples:
STRINGFROMID(56) returns “Complex”
STRINGFROMID(202) returns “Real”

REPLACE

Syntax: REPLACE(object

1

, start, object

2

)

Replaces part of object

1

with object

2

beginning at start.

The objects can be matrices, vectors, or stings.
Example:

REPLACE("12345",”3”,”99”) returns "12995"