Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » General

Post new topic   Reply to topic
HELP (No. 2)
View previous topic :: View next topic  
Author Message
lay_z_boy00
Regular


Joined: 26 Jan 2004
Posts: 57

PostPosted: Jan 27th, 2004 05:04 AM    Post subject: HELP (No. 2) Reply with quote

ok this is my string "Microsoft Visual Basic" how do i get all three words seperate?

plz help
Back to top
View user's profile Send private message Send e-mail
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Jan 27th, 2004 05:07 AM    Post subject: Reply with quote

Code:
Private Sub Form_Load()
 Dim Ar() As String
 Dim i As Integer
 Ar = Split(StrVarName, " ")
 For i = 0 To UBound(Ar)
  MsgBox Ar(i)
 Next
End Sub

_________________
No one is completely useless. They can at least be an example of what to avoid.
Back to top
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
Avis
Junior Poster


Joined: 07 Oct 2003
Posts: 510
Location: India

PostPosted: Jan 27th, 2004 05:08 AM    Post subject: Reply with quote

Hi!

You use the Split function to split the words. So the code for this will be:

Code:
Dim getStr() As String
getStr = Split("Microsoft Visual Basic", " ")

MsgBox getStr(0)
MsgBox getStr(1)
MsgBox getStr(2)


Hope this helps!
_________________
Code Snippets, Tutorials, Utilities, Controls

Low cost Web Hosting
Hosting starts at as low as $4 per year!


Always follow posting guidelines
Put your VB code in [vb ] your code [ /vb] tags!
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger ICQ Number
lay_z_boy00
Regular


Joined: 26 Jan 2004
Posts: 57

PostPosted: Jan 27th, 2004 05:08 AM    Post subject: Reply with quote

thx once again Biggrin
_________________
Lay_Z_Boy00
Back to top
View user's profile Send private message Send e-mail
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Jan 27th, 2004 05:15 AM    Post subject: Reply with quote

No prob Wink
_________________
No one is completely useless. They can at least be an example of what to avoid.
Back to top
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » General All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic