Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Split function in string
#11
Solved: 10 Years, 7 Months, 3 Weeks ago
Hi,

I think there is nothing to split in "blah 1234" with respect to chars.

If u use a split function for "This is good" by space as delimiter then following result will be displayd.
This
is
good

I am not sure of split function with regard to the numeric values.
Reply
#12
Solved: 10 Years, 7 Months, 3 Weeks ago
Hi I have a text file contaning email ids. I need to kow how many email ids are there. Each is separated by ;

I wrote this code but didnt work

Code:
Dim FSO
Dim ObjTxtF1
Dim ObjTxtF2

Set FSO=CreateObject("Scripting.FileSystemObject")
Set ObjTxtF1=FSO.OpenTextFile("C:\t1.txt",1)

i=0
    text=ObjTxtF1.ReadLine
    Do Until ObjTxtF1.AtEndOfStream
     Y=split(text,";")
        i=i+1
       msgbox Y(i)
     Loop
     msgbox i

ObjTxtF1.Close
Set FSO=nothing
Reply
#13
Solved: 10 Years, 7 Months, 3 Weeks ago
Thanks selvam. name of variables looks different Smile
Reply
#14
Solved: 10 Years, 7 Months, 3 Weeks ago
(05-22-2011, 06:40 PM)sreekanth chilam Wrote: Hi,

Refer the below example:

 
Code:
var="blah 1234"
  sp_var=split(var, " ")

  For i=lbound(sp_var) to ubound(sp_var)
      msgbox  sp_var(i)
  Next
Thanks for this @sreekanth chilam, work like a charm
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question Split Function Chaithra N 0 997 12-18-2019, 11:33 AM
Last Post: Chaithra N
  Split a string with multiple delimiters in VBScript nandha 2 7,882 02-10-2018, 06:44 PM
Last Post: nandha
  Calling a function in a Test Script from a function library anupam4j 3 5,876 06-26-2015, 12:31 AM
Last Post: babu123
  Replace a string in a word document with another string rekha.naik 8 14,918 11-14-2013, 12:58 PM
Last Post: pranikgarg
  Split Function diya 2 5,518 11-28-2012, 08:49 PM
Last Post: diya

Forum Jump:


Users browsing this thread: 1 Guest(s)