TI-BASIC Wiki
Advertisement
(84) :sub(String,off,len)

It returns a string composed of len characters after the offth character in the original string.

Location[]

In the catalog

Example[]

  • sub("12345",2,2) returns "23"
:"JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC"→Str1 
:Disp "GET ABBR OF WHICH" 
:Input "MONTH NO?",A 
:Disp sub(Str1,A*3-2,3

If the input is less than 12, this program will return a three letter abbreviation associated with the month. For example: if the input is 1, the result will display a substring of Str1 starting at char (1*3-2 = 1) with a length of three. It will display JAN.

Advertisement