Guest User

Untitled

a guest
Jul 19th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. alert(str.indexOf("?")); // returns position as integer if present, -1 otherwise
  2.  
  3. if(str.indexOf("?") !== -1) {
  4. // present
  5. }
  6.  
  7. str.search("\?")
  8.  
  9. alert(str.search("\?"));
Add Comment
Please, Sign In to add comment