How i Remove the whitespace only in last of string if exist?

I have a string and sometims the string has whitespace in the last of string. so i want to remove the whitespace in the last of string.

1 Like

Hi @L_Odilon_Petra_I ,
You can try


How about TrimEnd method?

yourString = yourString.TrimEnd


Hi @L_Odilon_Petra_I
Try this:

yourStringVariable = yourStringVariable.TrimEnd

Hope it helps!!

Hi, you can use below expression:

inputString = inputString.TrimEnd()

.TrimEnd() is a method that can be called on a string in UiPath (as in many programming languages). It removes any trailing whitespace characters from the end of the string. Whitespace characters include spaces, tabs, and newline characters.

Hi @L_Odilon_Petra_I

Check out this video for Trim details


Hi @L_Odilon_Petra_I

Use simply TRIM

Hope this link helps you a detailed explanation of string manipulation Trim and other too.

Use simply TRIM
This will remove all white space before and after to the string
use a assign activity like this

Strinput = Strinput.ToString.Trim

Cheers @L_Odilon_Petra_I

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.