Trim or substring

To remove last three characters from string you can use string.Substring(Int32, Int32) and give it the starting index 0 and end index three less then the string length. It will get the substring before last three characters.

myString = myString.Substring(0, str.Length-3);

it retrieves a substring from this instance. The substring starts at a specified character position

You can also using String.Remove(Int32) method to remove the last three characters by passing start index as length - 3, it will remove from this point to end of string.

myString = myString.Remove(myString.Length-3);

String.Substring Method (Int32, Int32)
String.Remove Method (Int32)

Or

If you wants to remove the all text after “" character the also first you can find the position of "” character in the string(using string.indexof(“_”)) then you can use the string.substring with that position length

if there will be multiple “" character in string then you can use string.Lastindexof("”) to find the last postion of that character.

For your reference to find the position and remove the rest text please see the attached sample workflow:

Remove_strin_after_underscore.xaml (7.0 KB)

Regards…!!
Aksh

10 Likes