How to retrieve alpha bate from the alphanumeric string with
special character.
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / audi7784
Str ="a0%n1@a2&n3)d4*h"
For intval=1 to Len(Str)
StrVal = Mid(Str,intval,1)
If isNumeric (StrVal) = True Then
StrNum = StrNum&StrVal
Else
StrChar = StrChar&StrVal
End If
Next
msgbox StrNum
msgbox StrChar
Is This Answer Correct ? | 7 Yes | 1 No |
Answer / nahush
str="Hello Uda543y %%^&"
Set objRegExp = new RegExp
objRegExp.pattern = "[a-z A-Z]"
objRegExp.global = true
Set matches = objRegExp.execute(str)
For each x in matches
result = result & x.value
Next
MsgBox result
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / qtpbibhu@gmail.com
Str="BIBHU@#$%^^&*(sundar)(*&das" how to retrieve alpha
bates and how to retrieve special characters
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / dinesh rathod
The special characters I have chosen are just an example. Add your ... I am assuming that by "alphabet" you mean A-Z. .... Is it possible to get 0 by subtracting two unequal floating point numbers?
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / nihar
str="BIBHU@#$%^^&*(sundar)(*&das"
set reg=new regexp
reg.global=true
reg.ignorecase=true
reg.pattern="[W]"
set x=reg.execute(str)
for each res in x
result=res.value&result
next
msgbox result
Is This Answer Correct ? | 0 Yes | 0 No |
unable to get item from the combobox using descriptive programing. can any one give me the peice of code to schedule the booking from one place to another using DESCRIPTIVE PROGRAMING.
How do I lauch my test website using code from qtp in different environmet, uat and PPTE?
How to handle dynamic objects in quicktest professional?
Do we have to Enable Smart Identification while running Or will it automatically be enabled ?
Hi,EXCEL SHEET AND DATA TABLE . BOTH ARE SAME OR NOT?
hi this is srinivasa(from blr) i complited my B.tech(e.c.e) in 2007 im searching job in s/w testing but idont have freshers resume for s/w testing please send some s/w testing resume for me(fresfers resumes only) advns thnks you
in a web page hoe to check the dynamic links that rechabging with out using regular expressions
· What should test in BANKING DOMAIN application ?
What are the benefits of qtp?
write progamming connecting QTP to database sql? this is question asked by interview? pls any answer this?
Where should we turn Smart Identification ON in QTP?
What is the extension of the recovery scenario file in qtp?