Finds a search string in another string.
inString(string, search-string,[)
Menu Location
- Press 2nd MATH to enter the MATH popup menu.
- Press D to enter the Strings submenu.
- Press 6 to select inString(.
This command works on all calculators.
3 bytes
The inString() command searches for one string inside another, starting from the beginning and going forward. If it finds the string, it returns the position where it finds it. If it doesn't find the string, it returns 0. If the string is there multiple times, it will only find the first one.
Optionally, you can also give inString() a starting position. In that case, it won't find any occurrences of the strings earlier than that position.
:inString("Chop shops stock chops.","hops")
7
:inString("Chop shops stock chops.","hops",8)
20
:inString("Chop shops stock chops.","stocks")
0