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 |
any one can explain about QTP proocess,means where to start and how to start Scripting.
Hi Friends, Can any one answer this question? 17) What method is used to retrieve the number of columns in the query results? A. Fields.Count B. Fields.Item(EOF) C. Fields.Count(BOF) D. Fields.Count.Value
How to run scripts 1,29,3,5,7,2 scripts using test batch runner in QTP.... Ie...I wanted to run scripts not in an order 1,2,3,4,5...like that How it is possible using test batch runner... I dont want hardcoded script
what is the difference btn risks & Therads in the Test plan documentation?
suppose i login into gmail page after that i read all the messages (say 10 messages) i have to send (SAVE) the messages in Html,notepad and i have to replay(Compose) send the messages please give me the code and give mail id so that i can clear my question
if full in Object Repostoiory then how to load other Object Repository
What are the differences between QTP 9.2 and 10? please explain e indetail......
How to create an Action Template?
Actually How do we use this Smart Identification Technology during Recording mode.
Hi, I Would Like to Know which is the Best QTP Certification Training Institute in Hyd? Thanks in Advance kishan
Is text area check point supports for web applications?
What is meant by Step generator?what is the use of this? we have 3 steps know there what r all those.? can u all pls give me clear idea of this