Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function isCharPresent(str, chr){
- for (let i = 0; i < str.length; i += 1){
- if (str[i] == chr){
- return true;
- }
- }
- return false;
- }
- function charIndexOf(str, chr){
- for (let i = 0; i < str.length; i += 1){
- if (str[i] == chr){
- return i;
- }
- }
- return -1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement