Dear all,
How does one search for occurence of a character in a string in Javascript. I would like to know more about the string manipulation functions of Javascript.
Printable View
Dear all,
How does one search for occurence of a character in a string in Javascript. I would like to know more about the string manipulation functions of Javascript.
indexOf() is what you want
eg:
http://www.irt.org is an excelent resource and should answer 96.7% of your javascript problemsCode:
var strTemp = "Mark Sreeves";
document.write(strTemp.indexOf("r"));
(you can even download the whole site to your hard drive for browsing of line)
Thanks Mark http://www.irt.org solved more than 96.7% of my problems. Thanks again.