You can use string.indexOf('a')
.
If the char a
is present in string
:
it returns the the index of the first occurrence of the character in
the character sequence represented by this object, or -1 if the
character does not occur.
You can use string.indexOf('a')
.
If the char a
is present in string
:
it returns the the index of the first occurrence of the character in
the character sequence represented by this object, or -1 if the
character does not occur.