How to retrieve alpha bate from the alphanumeric string with
special character.

Answers were Sorted based on User's Feedback



How to retrieve alpha bate from the alphanumeric string with special character...

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

How to retrieve alpha bate from the alphanumeric string with special character...

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

How to retrieve alpha bate from the alphanumeric string with special character...

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

How to retrieve alpha bate from the alphanumeric string with special character...

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

How to retrieve alpha bate from the alphanumeric string with special character...

Answer / shekhar

a="she25bh3k"

set reg=new regexp
s1="[a-z]"

reg.pattern=s1
reg.ignorecase=true
reg.global=True

set matchs=reg.execute(a)

for each match in matchs

a= match.value
''msgbox b
str=str&a

Next
msgbox str

Is This Answer Correct ?    1 Yes 1 No

How to retrieve alpha bate from the alphanumeric string with special character...

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

How to retrieve alpha bate from the alphanumeric string with special character...

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

Post New Answer

More QTP Interview Questions

How can you capture(Read) the values from a Table?

1 Answers  


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

0 Answers  


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?

0 Answers   CTS,


While scripting do we use any reference. may be we have 2 0r more same objects that time how do we write scripts

2 Answers  


What is ‘object spy’ and what is the function of object spy in qtp?

0 Answers  






How to import the Test Results in QTP to an Excel sheet

4 Answers   Sonata,


how we will use output values in qtp? is there any possibulity by descriptive programming?

2 Answers  


What are they Advantages and Disadvantages in QTP 9.2?

1 Answers   Infotech,


How do you compare the structure of 2 tables in database and check whether they are similar using qtp.

0 Answers  


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

2 Answers  


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.

1 Answers  


Why we have to split actions in a test?

4 Answers  


Categories