Jeff D. Hamann
2005-10-06 13:58:07 UTC
I've got to modify a javascript script (if that's what I'm supposed to call
them) to perform the following operation on a string:
· Eliminate all vowels except for a leading vowel (i.e., first
character is a vowel).
RESERVIOR ---> RSRVR
MEASUREMENT ---> MSRMNT
· Reduce double-consonants to a single instance of the consonant.
ADDRESS ---> ADRS
· If the algorithm results in the formation of a double consonant,
then reduce the double consonant to a single instance of the consonant.
STATION ---> STTN ---> STN
I've never written any javascript code before (I'm modifying a small script
so much of the basic work is done) and I need to perform a few search and
replaces on a string (remove the vowels, and double consonants), rinse and
repeat.
Any hints?
Jeff.
---
Jeff D. Hamann
Forest Informatics, Inc.
PO Box 1421
Corvallis, Oregon USA 97339-1421
541-754-1428
***@forestinformatics.com
www.forestinformatics.com
them) to perform the following operation on a string:
· Eliminate all vowels except for a leading vowel (i.e., first
character is a vowel).
RESERVIOR ---> RSRVR
MEASUREMENT ---> MSRMNT
· Reduce double-consonants to a single instance of the consonant.
ADDRESS ---> ADRS
· If the algorithm results in the formation of a double consonant,
then reduce the double consonant to a single instance of the consonant.
STATION ---> STTN ---> STN
I've never written any javascript code before (I'm modifying a small script
so much of the basic work is done) and I need to perform a few search and
replaces on a string (remove the vowels, and double consonants), rinse and
repeat.
Any hints?
Jeff.
---
Jeff D. Hamann
Forest Informatics, Inc.
PO Box 1421
Corvallis, Oregon USA 97339-1421
541-754-1428
***@forestinformatics.com
www.forestinformatics.com