Forum Moderators: open
Regards
Gerry
There is some great information on Regular Expressions here: [regular-expressions.info...]
Based on that, this is what a script like that would look like. You can toggle the
useOnlyVowels variable... <script type="text/javascript">
useOnlyVowels = true;
myText = "Weather";
noVowels = /[aeiou]/ig;
onlyVowels = /[^aeiou ]/ig;
if(useOnlyVowels) {
myText = myText.replace(onlyVowels,"");
}
else {
myText = myText.replace(noVowels,"");
}
document.write(myText);
</script>