How to retrieve alpha bate from the alphanumeric string with
special character.

Answer Posted / uday

If you are looking to retrieve only alphabet string from the
input, use below code:

str="BIBHU@#$%^^&*(sundar)(*&das"

Set r=new regexp
r.pattern="[a-z A-Z]"
r.global=true
set s=r.execute(str)
'For each letter in s
'result= letter.value&result
'Next
For i=s.count -1 to 0 step -1
Set oVal=s.item(i)
result=oVal.value&result
next
print result

To retrieve only special characters from the input use the
below regular expressions in the above code:
r.pattern="[^a-z A-Z]"
r.pattern="\W"


Thanks,
Uday
http://qtpftvideos.blogspot.com/

Is This Answer Correct ?    8 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Mention the test steps of qtp.

749


how u will evaluate the tool for test automation?

1604


How you can find length of array in qtp?

762


Hi, I am using OutputCheckPoint for 2 webelements Bed:4 and Bath:2 Full,1 partial in my result page and I am storing the value in the data table. I dont need the string Bed:4,I would like to get only the no 4. How can I get it? Even though I highlight only 4,It is seleting the full value "bed 4". Same thing happend for second webelement Bath:2 Full,1 partial I need only the No 2. I used the following to split MyArray = Split(UIBathResult, " ", -1, 1) But it is giving the value My Array(0)=Bath:2full,1Partial I need the only the nos for further comparision.Any help? Thanks Uma

3624


How do you know the location Id of an object if you know its index id?

798


What is Port testing. Whhen will you perform?

1703


Hi All, we are using QTP Automation Scripts to test SAP. I recorded QTP Automation Scripts in English-based SAP GUI. Now we have to test a French-based SAP sytem and use the same scripts. The QTP scripts are failing when executed on the French-based SAP System due to Object Recognition Issues. What can we do? Do I re-record the scripts in the French-based SAP system?

2565


which type of testing process are you following in ur company? how to recognize a qtp page?

1584


you are recording on "WINDOW 1", say it has a link if you click on that, that leads you to "WINDOW 2". If you do any manipulations on "WINDOW 2" that are automatically updated in to "WINDOW 1". But "WINDOW 1" is currently invisible. But the updations in "WINDOW 1" must also be recorded as a script in QTP. The best Example is if you update your resume in JOB STREET portal it actually happens in other window, but the previous window is automatically updated. Now does QTP help you in this types of situations? Any body can answer this question. please..... Siva

1694


When you open QTP, how many sheets you can see?

846


What are the advantages of Object Repository?

816


What are the disadvantages of recording test cases in qtp?

808


Why do you create a text checkpoint on a Web application? What is the purpose of the Close method?

1582


What are the different attributes used with regular expression?

767


How to give a call to another action from one action?

851