The inString() Command


Command Summary

Finds a search string in another string.

Command Syntax

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(.

Calculator Compatibility

This command works on all calculators.

Token Size

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")
:inString("Chop shops stock chops.","hops",8)
:inString("Chop shops stock chops.","stocks")

Related Commands

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License