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

An object is non standard object, i mapped it to standard object, eventhogh on mapping to standard object i cannot use the methods available on the standard object with the mapped object. How i can use those standard object methods with these mapped object. (((Note : dont tell that we can use virtual object as virtual object is to map nonstandard obj to standard obj)))

1837


please post the interview questions for QA position in FACTSET

4210


How to read a text file from QC using QTP. I would like to do something like this. But instead read a file from QC and NOT from my local drive. Set fso = CreateObject("Scripting.FileSystemObject") Set InputFile = fso.OpenTextFile("C:\test.txt", ForReading) Thanks

3016


In Remote acess server how u run a test?

1493


How is UFT 11.5 version different from UFT 12.0?

821


what are the frame work models of qtp?which frame work you follow in your company?and explain it process?

2271


How to analyzing the checpoint results?

752


What does it mean when a check point is in red color? What do you do?

812


How to run a test using quicktest professional?

747


How to open a new test using quicktest professional (qtp)?

764


If you have two monitors one is of 19inch and the 2nd one is of 24inch,if you want to write same QTP script in both the two monitors is there any changes required in the script?

1784


What is the difference between a Function and Action in QTP?

863


Our company is having a windows client server application developed in vb.net. so there is a treeview and i am not in a position to record the click events in QTP. so kindly help. Vivek

1821


How to find operating system information using the qtp script?

842


Hi Frenz... I would like to take up the QTP certification . Can anyone tell me what is the procedure. n if anybody have the study materials pls fwd it to jkpunathil@gmail.com

1740