Verification of Palindrome using VBScript

A palindrome is a word, sentence, verse, or even number that reads the same backward or forward. For example- ATATA, BOB, 12321

In order to verify a string for the palindrome using VBScript, first you need. to reverse it and then compare it with the original value to check if both are equal. If both the values are equal then it can be called a Palindrome.

Example code: Verification of Palindrome using VBScript
Function isPalindrome()

    Dim oStr
    
    oStr="bob"
    fStr=StrReverse(oStr)
    If oStr=fStr Then
        Print "The Given String "&oStr&" is a Palindrome"
        bPalindrome= true
        else
        Print "The Given String "&oStr&" is not a Palindrome"
        bPalindrome=false
    End If
    isPalindrome=bPalindrome
End Function

You may also read


Discover more from automationscript

Subscribe to get the latest posts sent to your email.

Similar Posts

Leave a Reply