Right Click Disabled

Thursday, February 23, 2012

VBScript code in QTP to display given value is Palindrome


Option explicit
Dim val, res
val=inputbox("Enter any value : ")
res=strreverse(val)
If val=res Then
   msgbox(val&" is a Palindrome.")
   else
      msgbox(val&" is not a Palindrome.")
End If

OR

Option explicit
Dim val, res
val=inputbox("Enter any value : ")
res=strreverse(val)
If strcomp(val,res)=0 Then
   msgbox(val&" is a Palindrome.")
   else
      msgbox(val&" is not a Palindrome.")
End If

No comments:

Post a Comment

Twitter Bird Gadget