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
Approach for Installation,comaptibility,system testing
How to associate shared object repository to test in qtp?
Explain how you can delete excel file in qtp?
1. wat are the main diff b/w QTP 8.0 AND QTP 9.2 ( not user interface) 2. wat is the meaning of Keyword in keyword driven frame work? 3. how u will handle the unknown errors while exucution. (not recovery scenario)
Define virtual object?
How can I find out the cursor position through QTP suppose I am keep tabbing(Pressing the tab key continuously) and stoped at a position Now I want to find out where the cursor position is
What is quicktest professional (qtp window?
whare exactly we have to use functions and sub routain
one screen page,that contains file , browse , update and cancel buttons.when we browse a file it should get update otherwise it should go to previous page.write negative test case for that.
What is the default object synchronization timeout in qtp?
"What are the common constrains that we need to consider when we prepare testcases for ASP application". Thanks in Advance...
How will you check a web application for broken links using qtp?
In order to select an automation tool for automating ur application, what r the things u need to consider? For eg i will go for automation; 1) When there is a lot of retesting and regression testing. 2) Return on investments. 3) Whether the tool supports the appln. 4)--------------, etc. Pls give me more number of points because my answer did not satisfy the interviewer. Very urgent pls
Is any limitation to xml checkpoints?
What is the extension of qtp local repository?