980
Appendix A: System Routines — Strings
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
push_instring
Declaration:
void
push_instring
(EStackIndex
i
, EStackIndex
j
, EStackIndex
k
)
Category(ies):
Strings
Description:
Searches for a substring within a string.
Inputs:
i
— The string to search.
j
— The substring to search for.
k
— The starting position.
Outputs:
Returns a tokenized integer on the estack. The integer represents the
position of the first occurrence of substring
j
within the search string
i
at or
after the start position
k
. If the substring is not found, zero is pushed.
Assumptions:
None
Side Effects:
May expand expression stack and may cause heap compression.
Availability:
On AMS 1.05 and higher.
TI-89 / TI-92 Plus
Differences:
None
See Also: push_char, push_format, push_ord, push_str_to_expr, push_string,
push_zstr
Example:
If i indexes the bolded tag in the following tokenized string “hello”
0 h e l l o 0
STR_DATA_TAG
and j indexes the bolded tag in the following tokenized string “l”
0 l 0
STR_DATA_TAG
and k indexes the bolded tag in the following tokenized integer 1
1 1
NONNEGATIVE_INTEGER_TAG
then
push_instring (i, j, k);
pushes the tokenized integer 3.
3 1 NONNEGATIVE_INTEGER_TAG