Micro Focus QTP (UFT) Forums
Split Function - 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 (/Thread-Split-Function)



Split Function - diya - 11-27-2012

Hello

I was trying this code to get the count for the inbox and searched and tried to learn and do it.

Iam not able to understand the split function used below.What is that "(1)" used for.

Code:
emailcount=split(inboxvar," ")(1)
emailcount=replace(emailcount ,"(","")
emailcount=replace(emailcount ,")","")


The result iam getting correctly but not able to understand the syntax also.
please explain as what is going on here


RE: Split Function - Saleel Prabhu - 11-28-2012

Code:
Text = "I Like QTP"
str1 = Split(Text," ")(1)
msgbox str1

str1 will have value <<Like>> (Value at index 1 after Splitting the string)

Regards,
Saleel


RE: Split Function - diya - 11-28-2012

Thanks Saleel.

thanks for the reply..really appreciate it as none replied