1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| Function ObtenirVoyelles(ByVal word As String, _
Optional blnVoyellesConsomnes As Boolean = True) As String
Const strVoy As String = "aeiouy"
Const strIgnore As String = " -."
Dim strRes As String
For i = 1 To Len(word)
If InStr(strIgnore, Mid(word, i, 1)) = 0 Then
If blnVoyellesConsomnes Then
If InStr(strVoy, Mid(word, i, 1)) Then
strRes = strRes & Mid(word, i, 1)
End If
Else
If InStr(strVoy, Mid(word, i, 1)) = 0 Then
strRes = strRes & Mid(word, i, 1)
End If
End If
End If
Next i
ObtenirVoyelles = strRes
End Function |
Partager