var str = "Pratik"
var str1 = String(str.reversed())
if (str == str1)
{
print("String is Palidrome")
}
else
{
print("String is Not Palidrome")
}
var str = "aba"
var str1 = String(str.reversed())
if (str == str1)
{
print("String is Palidrome")
}
else
{
print("String is Not Palidrome")
}
No comments:
Post a Comment