but boggled about how to do this

Posted by David B on Thu 17 Jul 2003 07:13 AM — 3 posts, 13,943 views.

USA #0
I'd like to take make an alias for the IC channel

ic *

Thats easy, I'd like to take the wildcard and replace any vowels with a particular letter.

if i Ic something, it'd replace all the vowels with a letter i choose.

I.E. you ic 'You know I think your right'

becomes:
you ic 'UUU knuw U thunk uuur rught'

Or something to that affect.

I'm not too sure where to start, I know I'll probably have to use the split command, and case to replace the letters, Thats not the hard part, its re-forming the sentence and what not.

If this isn't even possible lemme know.
Greece #1
I can't write the actual code now, but what I will tell you it should be easy. This is only pseudocode

Dim vowels = "aeiou"
Dim intcounter

For intcounter = 1 to len(strword)
if instr(vowels, mid(strword, intcounter, 1)) > 0 then
strstring = strstring & "<the letter you want"
else
strstring = strstring & mid(strword, intcounter, 1)
end if
next

It basically looks at the letters one by one. If a letter is a vowel, it copies another letter in the string. If not, it copies the actual letter.
I don't remember how mid and instr work offhand, you should look them up.
Australia Forum Administrator #2
If you want to replace all vowels with the same letter you could use the replace script function, eg.

str = world.Replace ("str", "a", "u", vbTrue)
str = world.Replace ("str", "e", "u", vbTrue)
str = world.Replace ("str", "i", "u", vbTrue)
str = world.Replace ("str", "o", "u", vbTrue)

This is a bit inefficient, as you are doing it 4 times (you won't need to replace U by itself) however it might not be much slower than doing it in a loop.

My example doesn't preserve capitalisation, you might need another 4 lines for the upper-case letters.