What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » [split] VBScript & pig latin

[split] VBScript & pig latin
Author: Message:
theimmortal_7
New Member
*


Posts: 1
Joined: Oct 2008
O.P. RE: VBScript & coding tips
Maybe you guys can help me out, I'm trying to make a vbscript that uses the replace method and pattern property to takes a user's input, move the first letter of each word to the end of the word, then add a couple letters. This is what I've got, but it moves the last letter of the second word to the start of the second word. I'm stumped on this. Its supposed to translate text into pig latin.

Dim Message
Dim Title
dim result
set shellobj = CreateObject("WScript.Shell")
Message = "test"
Title = "test"
result = InputBox(Message,Title,"test", 2000, 2000)
Function ReplaceTest(patrn, replStr)
  Dim regEx, str1
  str1 = result
  Set regEx = New RegExp
  regEx.Pattern = patrn
  regEx.IgnoreCase = True
  ReplaceTest = regEx.Replace(str1, replStr)
End Function
MsgBox(ReplaceTest("(\s+)(\S+)(\S+)", "$1$3$2") + "ay")
10-04-2008 03:11 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
RE: VBScript & coding tips - by theimmortal_7 on 10-04-2008 at 03:11 AM
RE: VBScript & coding tips - by Jarrod on 10-04-2008 at 05:14 AM
RE: VBScript & coding tips - by CookieRevised on 10-04-2008 at 09:43 AM
RE: VBScript & coding tips - by Jarrod on 10-04-2008 at 09:55 AM
RE: VBScript & coding tips - by CookieRevised on 10-04-2008 at 10:11 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On