In this topic, you will learn about, Event procedure that accepts a string as input and checks whether it is a palindrome or not.
Step 1: Tools —–> Procedure
Step 2:
Step 3:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
public function palindron(str as string) Dim J as integer ,i as integer ,temp as integer J=UBond(str) For i=LBound(str) to J If mid(i,0)=mid(j,0) then Temp=1 Else Temp=0 Exit for Endif Next J=J+1 Next End function If temp=1 then Msgbox(‘’its palindrom’’) Else Msgbox(‘’Its not palindrom’’) Endif endsub |
Comment below if you have queries related to the above article.