Write a VB Script Program to check given string is Palindrome? - TestingQ.com

-->Exclusive Portal for Testing Jobs

Write a VB Script Program to check given string is Palindrome?

Ans: We can check given string is palindrome or not in 2 ways

1) Using StrReverse function

checkStr=Inputbox("enter a srting to check palindrome")
reverseStr=strReverse(checkStr)

If checkStr=reverseStr Then
   msgbox "entered string is palindrome"
else
  msgbox "entered string is not a palindrome"
End If

(OR) 

2) we can check it without using StrReverse Function

checkStr=Inputbox("enter a srting to check palindrome")
temp=checkStr
reverseStr=0

Do while temp>0
r=temp Mod 10
reverseStr=reverseStr*10+r
temp=Int(temp/10)
Loop

If Int(checkStr)=reverseStr then
   msgbox "entered string is palindrome"
else
   msgbox "entered string is not a palindrome"
End If 


To receive daily posted JOBS & Interview Questions
Just enter your email address below and click 'Submit'
Enter your email address:

Make sure to activate your subscription by clicking on the activation link sent to your email