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 |
Anybody plz give, How do you test aframe in a web page? If page cotain text message or Images, tables?
Hi Guys, In one of my interviews, I was asked to Write a paragaraph explaining how much scripting I did in QTP? I don't know where to start and what to write. So I need your help in writing that.
what is database check point, how will you parameterize the database from seperate data table?
How to test menu options using qtp
Can any one tell me about "Mapping Repository Parameter Values" and why we use it....??How to use it???Please, tell the preconditions also...........???? Thanks in Advance
How to create runtime property for an object?
what are the environment variables,how do you use them. give an example.
I am verifying the actual vs the input value to make sure that they been entered correctly. In the Global Sheet I have a column called Customer with the multiple names in each row and now I am trying to capture the value during runtime under the column name Customer_in_Apps. Somewhat it works but during runtime the values are being stored in each column vs each row i.e., Customer_in_Apps, Customer_in_Apps1. Automatically it add columns instead of rows. row=datatable.getsheet("Global").GetRowCount for x=1 to row datatable.getsheet("Global").SetCurrentRow(x) Window("Customer Desktop").Window("Customer Tracking (Privacy").WinObject("TreeView20WndClass").Click 92,244 runtimevalue = .VbTreeView("vbname:=AppServerTree").GetROProperty("Selectio n") Val1=Datatable.Value("Customer",dtGlobalSheet) Val2 = Datatable.GlobalSheet.AddParameter("Customer_in _Apps",runtimevalue) If (trim(Val2)=trim(Val1)) Then Reporter.ReportEvent micPass, "Customer validation successful", "Actual Value: " &Val1&vbcrlf& "Customer Value: " &_Val2 else Reporter.ReportEvent micFail, "Customer validation unsuccessful", "Actual Value: " &Val1&vbcrlf& "Customer Value: " &Val2 End If Next
What scripting language QTP of?
how u will evaluate the tool for test automation?
how to click on object? (with out knowing the object details) for ex: in a webpage one link is available.i want to click that link by using one menthod through qtp?
How to handle Run-time errors?