September 08 2010 08:16:10
Navigation
· Home
· Online Store
· Course Outlines (PDF Files)
· Sample Videos
· Contact Info
· Web Links
· Articles (Sample Code)

Other Videos
· WordPress (CMS)
· Joomla (CMS)
· Sharepoint

Other
· FAQ
· Search
Contribute to This Site
· Submit Link
· Get Benefitted Sites
No Competition
One of our so-called competitors offers under 6 hours of video training for a whopping $219 (choke, gasp, spew - you could hire a private tutor for that price). Did I mention that they ship their training on VHS tapes (remember those?). Check out our 'Course Outlines' link above. We offer a 2-days of training (15 hours) for $54 (2 CDs at $29 each). You watch our videos from a CD/ROM on your computer. We also include real-world lab/assignments in each course.
Articles: String Functions
String Functions
'==========================================================================
' NAME: StringFunctions1.vbs 
' Authors: Neal Walters 
' http://VBScript-Training.com 
'==========================================================================

text1 = "We the people of the United States, in order to form the a more perfect union..." 
'        1...5...10....5...20.. 

WScript.Echo "Text1=" & text1 
WScript.Echo "Length=" & Len(text1) 
WScript.Echo "Left(text1,2)=" & Left(text1,2)  
WScript.Echo "Right(text1,8)=" & Right(text1,8) 

WScript.Echo "Mid(text1,8,6)=" & Mid(text1,8,6)
WScript.Echo "InStr(text1,""United"")=" & InStr(text1,"United")

posFirstThe = InStr(text1,"the")
posSecondThe = InStr(posFirstThe+1,text1,"the") 
posLastThe = InStrRev(text1,"the") 
WScript.Echo "Position first 'the' = " & posFirstThe 
WScript.Echo "Position second 'the' = " & posSecondThe 
WScript.Echo "Position last 'the' = " & posLastThe 

WScript.Echo String(70,"-") 

userInput = "  Neal   Walters    " 
WScript.Echo "userInput='" & userInput & "'" 
WScript.Echo "ltrim(userInput)='" & ltrim(userInput) & "'" 
WScript.Echo "rtrim(userInput)='" & rtrim(userInput) & "'" 
WScript.Echo "trim(userInput)='" & trim(userInput) & "'" 

WScript.Echo String(70,"-") 




   
'==========================================================================
' Authors: Neal Walters 
' http://VBScript-Training.com 
'==========================================================================

text1 = "John,Doe,123 Main Street,Dallas,TX,75080"
'        1...5...10....5...20.. 
WScript.Echo "Text1=" & text1

myWords = Split(text1,",") 

For Each word In myWords
  WScript.Echo word 
Next 

WScript.Echo String(70,"-") 

For j = 0 To UBound(MyWords) 
  WScript.Echo "J=" & j & " myWords(j) = " & myWords(j) 
Next 

WScript.Echo String(70,"-") 

Firstname = myWords(0) 
Lastname = myWords(1)
Address = myWords(2)
City = myWords(3)
State = myWords(4)
Zip = myWords(5)

WScript.Echo "City=" & City & " Zip=" & Zip 

text2 = Join(myWords,"/") 
WScript.Echo "Text2=" & text2 

text3 = Replace(text2,"/","-")
WScript.Echo "Text3=" & text3

text4 = "05/10/2004" 
WScript.Echo Replace(text4,"/","-") 

Login
Username

Password



Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
Order Now - View Products


Default Shipping:
Phone: 214-403-6006
Our Sites
Software Training
XML-Online-Training.com
Biztalk-Training.com
SharePoint-Training.com
DotNet-AddOns-Training.com
CMSTrainingVideos.com

Language
LanguageLovers.com
Render time: 0.01 seconds 432,187 unique visits