HP Forums
operates the extraction of strings as [] - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: operates the extraction of strings as [] (/thread-3682.html)



operates the extraction of strings as [] - compsystems - 04-20-2015 03:34 PM

Phython operates the extraction of strings as subscripts [], This option PRIME facilitates the manipulation of string, that they are treated as arrays

HPPrime
Syntax: MID(string, position, [n])

Extracts n characters from string starting at position. If n is not specified, then MID extracts the remainder of the string from position.

Example:
MID("MOMOGUMBO",3,5) returns "MOGUM"
MID("PUDGE",4) returns "GE"

Python

´abc´[1] retorna 'b', because Python strings are handled from position 0
´abcdef´[0:2] retorna 'ab', the operator: inside the container [] is TO, as does also MATLAB