How do you find out whether the string is Numeric or Alpha
numenric.Suppose..'QTP is an automation testing tool 12345'
How should I know it is alphanumeric.Can any one please
write the code for this

Answers were Sorted based on User's Feedback



How do you find out whether the string is Numeric or Alpha numenric.Suppose..'QTP is an autom..

Answer / ashish sharma

str = "QTP is an automation testing tool "
Dim ianRegEx
Set ianRegEx = New RegExp
ianRegEx.Pattern = "[a-z]+[\s]*[0-9]+"
ianRegEx.Global = True
ianRegEx.IgnoreCase = True
msgbox ianRegEx.Test(str)

Is This Answer Correct ?    4 Yes 0 No

How do you find out whether the string is Numeric or Alpha numenric.Suppose..'QTP is an autom..

Answer / a.thirumalareddy@gmail.com

use this function it will help u..

Function IsAlphaNumeric()
If IsNull(str) Then str = "QTP is an automation testing tool 12345"
Dim ianRegEx
Set ianRegEx = New RegExp
ianRegEx.Pattern = "[^a-z0-9]"
ianRegEx.Global = True
ianRegEx.IgnoreCase = True
IsAlphaNumeric = (str = ianRegEx.Replace(str,"QTP is an automation testing tool 12345"))

msgbox IsAlphaNumeric

End Function

call IsAlphaNumeric()

Is This Answer Correct ?    4 Yes 2 No

How do you find out whether the string is Numeric or Alpha numenric.Suppose..'QTP is an autom..

Answer / xyz

Hi Tirumalareddy thanks for giving the reply.I have
executed the script.It is working fine for the above
srting.but if I removed 12345 from the string,still it is
displaying TRUE.I think it is not correct.anyhow thanks for
reply

Is This Answer Correct ?    2 Yes 0 No

How do you find out whether the string is Numeric or Alpha numenric.Suppose..'QTP is an autom..

Answer / mrclock

A.thirumalareddy was on the right track, but here is a
revised and working version of his code:

Function IsAlphaNumeric()
Dim strText: strText = "QTP is an automation testing tool
12345" 'Search String
Dim ianRegEx
Set ianRegEx = New RegExp
ianRegEx.Pattern = "[^a-z0-9]" 'Define Search Pattern
ianRegEx.Global = True 'Apply Globally
ianRegEx.IgnoreCase = True 'Ignore upper/lower case
IsAlphaNumeric = ianRegEx.Test(strText) 'Use Test method
for a True/False test
msgbox IsAlphaNumeric 'Display True/False
End Function

call IsAlphaNumeric()

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More QTP Interview Questions

What is the difference between browser sync and page sync in QTP?

2 Answers  


Hi, I'm a beginner in QTP and planning of a certification in QTP, but have no idea about it :P. Could anyone please tell me what certifications that a QTP- beginner can take? What is the fees and the syllabus for the certification? Please reply soon. Thanks Vidhya

0 Answers  


what is regular expression how will you implement it?

1 Answers  


How function returns a value?

1 Answers  


When you open QTP, how many sheets you can see?

0 Answers   Wells Fargo,


What is synchronization? What are the ways you can synchronize?

0 Answers  


Difference between action & Reusable action?

0 Answers  


How do I lauch my test website using code from qtp in different environmet, uat and PPTE?

0 Answers  


HI! I have completed my testing course in 2008. but now am working in banking sector as a data analyst and i want to move to an IT based company but am unable to understand whether i have to complete the testing course again and try for a job .

1 Answers  


How to use parameterization in qtp?

0 Answers  


Browser("Las Vegas Hotels - Las").Page("Vegas Hotels - Hotels").Link("Luxor") ......here Luxor is a hotel and this is recognised as a link. I have many hotels like Luxor, Palms etc which are all displayed as link...How do I parametrize this by using webtable functions??? ASAP

1 Answers   HP,


what are the attributes of QTP?

3 Answers  


Categories