Given a string variable contain a full name (last name,
first name), using vbscripting, how can you extract first
and last name and save them into two different variables.

Answers were Sorted based on User's Feedback



Given a string variable contain a full name (last name, first name), using vbscripting, how can yo..

Answer / uday

Use split method.

Here is the ex:

str="Uday,Anem" 'where Uday is first name and Anem is last
name
arr=split(str,",")
firstname=arr(0)
lastname=arr(1)

msgbox(firstname+" "+lastname)

Is This Answer Correct ?    8 Yes 2 No

Given a string variable contain a full name (last name, first name), using vbscripting, how can yo..

Answer / naveen arora

fullname = "Arora Naveen"
last = Left(fullname, InStr(1, fullname, " "))
print last
first = Right(fullname, InStr(1, fullname, " "))
Print first

Is This Answer Correct ?    5 Yes 1 No

Post New Answer

More QTP Interview Questions

What are the Mandatory Properties of WebTable Object and Link Object in Web testing using QTP

2 Answers   iLink,


Please explain me in detail! How to handle runtime errors in QTP useing recovery senario or with out scenario

5 Answers   Quinnox,


How do we run a test from the 3rd row of the datatable in QTP? Leaving the first two rows we need to test AUT from 3rd row to n'th row.

3 Answers   Virtusa,


Hi, How Accessibility checkpoint in QTP can be implemented in the test script?

0 Answers  


How to handle dynamic objects in QTP?

4 Answers   Infosys,






how will check the links in multiple pages at a time

3 Answers  


write a test script in QTP to test the text that written in an image(i.e jpg)of a web page???

0 Answers  


How to add check point?

2 Answers  


How to capture screen shots when an error occurs?

2 Answers  


Hai anyone please "Explain about Framework in QTP?"

6 Answers  


Error handling

3 Answers   Wipro,


How is recording done when a application is over lapping the QTP application it gives a message object not recorded

0 Answers  


Categories