Articles → UIPATH → Check If The String Is Palindrome Or Not In Uipath
Check If The String Is Palindrome Or Not In Uipath
Implementation
- Create a variable "MainString" that needs to be checked for palindrome
- Create a character array "inputCharArray"
Click to Enlarge
- Drag and drop the "Assign" activity and set the value of the "inputCharArray" variable to "MainString.ToCharArray()"
Click to Enlarge
- Drag and drop the "Invoke Code" activity and write the code to reverse the string. In the "Invoke Code" activity, pass one parameter "input" of type In/Out
Click to Enlarge
- Drag and drop the "If" activity to check if the original and reversed string is the same or not. If the strings are the same then the string is palindrome
Click to Enlarge
- Save and run the bot
Output
Click to Enlarge