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 |
How can you capture(Read) the values from a Table?
I want to do Certification course in QTP. For this I request you to suggest the best Tutorial in PDF format. Hence, if possible, kinldy mail PDF file to my mail-ID: sushmapokhriyal79@gmail.com
Client is able to provide budget..he want you to choose the automation tool for the web application? which one you will select ? QTP or Selenium ? what are the reasons?
While scripting do we use any reference. may be we have 2 0r more same objects that time how do we write scripts
What is ‘object spy’ and what is the function of object spy in qtp?
How to import the Test Results in QTP to an Excel sheet
how we will use output values in qtp? is there any possibulity by descriptive programming?
What are they Advantages and Disadvantages in QTP 9.2?
How do you compare the structure of 2 tables in database and check whether they are similar using qtp.
I want to create Excel object on another machine which is in network i written the code "Set se=createobject ("Excel.Application","\\ankur")"here \\ankur is the name of that machine but i m getting the error of permission denied create object can anybody help me
Can you write a script for to insert array elements in an excel A to Z columns only. if the number oe elements in the array is greater than the number of columns (A to Z), come to next row and proceed furthur. eah cell should contain only one array value.
Why we have to split actions in a test?