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
Explain the views in the QTP GUI?
Can we access the java methods in qtp. Because my requirement is to access the swt(for eclipse an it is java code) methods in qtp is it possible?
Why to use descriptive programming?
can u please explain what is the exact difference between qtp8.2 and 9.0
If I change the object name in one action will it be updated in all the actions? Or not?
Mention the test steps of qtp.
Does QTP10 supports Windows 7OS +IE 9 combination? Which is the preffered combination ,Plz let me know?
If there is a change in the object type eg: A button is changed as link, 1. How to edit that in the shared object repository. 2.What options are available to edit the object within shared object repository other than copy from loca; 3.What would be the effect of the change in Coded Scripts within QTP and Functions stored in .vbs file which are loaded and used in QTP
Hi, I got error message as "object does not support this property or method: "Test.Actions" when i execute the following line of script on QTP 9.0 Dim qtApp, qtRep Set qtApp = CreateObject("QuickTest.Application") Set qtRep = qtApp.Test.Actions("Action1").ObjectRepositories Can anyone tell me where i am wrong.
I have qtp 9.5 demo ver,I am not able to record the yahoo broeser.so anyone can tell me what setting i have to do in QTP for yahoo brower recording. why its not recognise the object of yahoo browser????
Dear sir, i want to perform a QTP automated testing for mechancial engineering software like msc adams, msc nastran this softwares will help for mechanical engineering design analysis>> i know oad runner win runner, test director, QTp>> but i dont know how to use for automation
What are the benefits of qtp?
can u explain relative path architecture framework in qtp?
How will internal and external links be validated and updated? how often?
write script for bitmap image?