daily pastebin goal
47%
SHARE
TWEET

Porównywanie stringów

a guest Jan 17th, 2016 9 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var haslo = "Ania";
  2. var wybranaLitera = "a";
  3.  
  4. for(var i = 0; i < haslo.length; i++) {
  5.  
  6.     if( haslo.charAt(i).toLowerCase() === wybranaLitera.toLowerCase() ) {
  7.         // wiemy, że dana litera to "a" lub "A" i możemy ją odkryć
  8.     }
  9.  
  10. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top