msgbox CheckPalindromeString("Hi madam how is you son oho")
Function CheckPalindromeString(Str)
Dim strPlidrome ,strPlidrome_Name
strPlidrome=0
strwords=split(Str," ")
for j=0 to Ubound(strwords)
For i = Len(strwords(j)) To 1 Step -1
Str2 = Str2 + Mid(strwords(j), i, 1)
Next
If strcomp(strwords(j),Str2)=0 Then
strPlidrome=strPlidrome+1
If strPlidrome<>1Then
strPlidrome_Name=strPlidrome_Name & " , "& strwords(j)
Else
strPlidrome_Name= strwords(j)
End If
End If
Str2=""
Next
CheckPalindromeString= "Polidrome words : " & strPlidrome & " ; " & strPlidrome_Name
End Function
Function CheckPalindromeString(Str)
Dim strPlidrome ,strPlidrome_Name
strPlidrome=0
strwords=split(Str," ")
for j=0 to Ubound(strwords)
For i = Len(strwords(j)) To 1 Step -1
Str2 = Str2 + Mid(strwords(j), i, 1)
Next
If strcomp(strwords(j),Str2)=0 Then
strPlidrome=strPlidrome+1
If strPlidrome<>1Then
strPlidrome_Name=strPlidrome_Name & " , "& strwords(j)
Else
strPlidrome_Name= strwords(j)
End If
End If
Str2=""
Next
CheckPalindromeString= "Polidrome words : " & strPlidrome & " ; " & strPlidrome_Name
End Function
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.