Posts: 1
Threads: 1
Joined: Feb 2013
Reputation:
0
02-26-2013, 12:14 PM
(This post was last modified: 02-26-2013, 12:21 PM by cherrycheran.)
hi i need to split a line,
say like the line will be like....
hai 1.how are you 2.where are you 3.what are you doing.
i need it in this format
hai
1.how are you
2.where are you
3.what are you doing
Posts: 1,003
Threads: 1
Joined: Jul 2009
Reputation:
5
02-26-2013, 01:18 PM
(This post was last modified: 02-26-2013, 01:18 PM by basanth27.)
Code:
ArrVal = Split("hai 1.how are you 2.where are you 3.what are you doing"," ")
For intCounter = Lbound(ArrVal) to Ubound(ArrVal)
msgbox ArrVal(i)
Next
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Posts: 1,003
Threads: 1
Joined: Jul 2009
Reputation:
5
02-26-2013, 02:47 PM
Do you really think this is required for a simple split and display? I mean, this may work but wouldnt it be the bull way of doing it?
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Posts: 1
Threads: 0
Joined: Apr 2013
Reputation:
0
04-11-2013, 09:54 PM
Hi
above code is going to split for each spaces, so the result would be
hai
1.how
are
you
2.where
are
you... etc
So using regular expression we can achieve as per the requirement.
Thanks