Micro Focus QTP (UFT) Forums
Split function in string - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Split function in string (/Thread-Split-function-in-string)

Pages: 1 2


RE: Split function in string - Ram2009 - 04-26-2012

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.


RE: Split function in string - nikhilcogni - 03-01-2013

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



RE: Split function in string - nikhilcogni - 03-02-2013

Thanks selvam. name of variables looks different Smile


RE: Split function in string - helmzshelmz - 07-07-2020

(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