Function Codes Ciphers Class

RemoveSomeVowels

Removes some characters representing vowels from the words in a string.

Signature (Visual Basic / VBA)

Public Function RemoveSomeVowels( _
      ByVal vValue As Variant _
    , Optional ByVal vRetainRatio As Variant _
    ) As Variant

Code Example

    RemoveSomeVowels("This is only a test.") = "Ths is nly a tst."

Parameters

Parameter Description
vValue String containing the phrase which is to have some of its vowels removed. Function returns Null if vValue is Null or cannot be fixed up to a String.
vRetainRatio Ratio of the word length without vowels to the word length with vowels under which vowels will be retained. The minimum acceptable ratio of the new word length of the old word length. vRetainRatio defaults to .6 (60%) if it is missing or Null or cannot be fixed up to a number.

Notes & Version History

Summary Vowels consist of the characters "A", "E", "I", "O", "U", plus certain accented "foreign" characters. Vowels will be removed from each word as long as the ratio of the word length without vowels to the word length with vowels is greater than or equal to vRetainRatio.
Note Function uses the built-in character classification routines to determine which characters represent vowels.