How do you locate the first X in a string txt?

Q

How do you locate the first X in a string txt? 

A) txt.find('X'); 
B) txt.locate('X'); 
C) txt.indexOf('X'); 
D) txt.countTo('X');

✍: Guest

A
(This question has not been answered yet. If you know the answer, please share it in a comment below.)

2022-10-19, 15319👍, 5💬