Created
November 20, 2016 15:52
-
-
Save sohana08/94673df5bb1264d5eb0c34f25e140960 to your computer and use it in GitHub Desktop.
i want to check whether a character of a string is a vowel or not but i dont have any idea of it. following is code i have tried of.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
function checkStr(string1) | |
{ | |
var vowel_list='aeiouAEIOU'; | |
for(var i=0;i<string1.length;i++) | |
{ | |
if(string1[i]!==vowel_list | |
{ | |
return false; | |
} | |
else | |
{ | |
return true; | |
} | |
} | |
} | |
document.write(checkStr("This is the string"); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
needed help