Write a code for, whether the given string is palindrome or not? Try without using built in functions
Welcome to the UiPath Community ![]()
Refer this thread for the logic you are looking for.
Thanks,
Ashok ![]()
Try this
Input.ToLower().SequenceEqual(Input.ToLower().Reverse())
Or
Sequence14.xaml (15.5 KB)
Cheers!!
Here’s a step-by-step explanation of the UiPath workflow along with the code:
Input Dialog: This activity prompts the user to enter a string and stores it in the variable inputString.
Assign Initial Values: This activity initializes the variables left and right. left is set to 0 and right is set to the length of the input string minus 1.
While Loop: This loop iterates as long as the left index is less than the right index. Inside the loop, it checks if the characters at positions left and right in the string are equal.
If Condition: Inside the loop, there’s an If activity that checks if the characters at positions left and right are equal. If they are, it sets the result variable to True.
Increment and Decrement: After each iteration, the left index is incremented by 1 and the right index is decremented by 1.
Result Message Box: Finally, after the loop completes, there’s an If activity to check the value of the result variable. If it’s True, it displays a message box saying that the string is a palindrome. Otherwise, it displays a message box saying that the string is not a palindrome.


