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 |
What is diff betwee datatable.importsheet "path" and datatable.import
what is test scheduling?
what happen in object repository(shared)if we call an existing action from an external action ? and what happen in object repository(peraction)if we call an existing action from an external action ?
What is use of object spy?
how and what kind of vb functions do us ein QTP?
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?
Hi Friends, How many types of Data Bases available in market... What is the diff. while using Syabase and Oracle in a Project... ? and what is the main diff. of Syabase and Oracle databases... ? Thanx in advance..
Can we use index on view?
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
I've some problem in Descriptive programming plz help me. I've written in a click event code in Functional library when I run this flight reservation program It is not run. How to I write multiple click event in functional library. My program is this. I have associate an action with functional library. Public Function ClickButton(byval ApplicationName, byval WindowName, byval ObjectName, byref Comments) If Dialog("text:=" &WindowName).WinButton("text:=" &ObjectName).Exist Then Dialog("text:=" &WindowName).Activate Dialog("text:=" &WindowName).WinButton("text:=" &ObjectName).Click Elseif Window("text:="&ApplicationName).WinButton("text:=" &ObjectName).Exist Then Window("text:=" &ApplicationName).Activate Window("text:=" &ApplicationName).WinButton("text:=" &ObjectName).Click End if End Function
what is the abbrivation of .mtr in action reposirtory?
Can the user toggle between using Local OR and shared OR for the same action?