How Can I Find the Position of a Character or String within a String

The index() function returns the position of the character or string.

We use the code below:

The same thing can be done with strings.

This is shown in the code below:

So the value returned is 12 because the position of 'F' in 'Free' is in the twelfth position.