Hello,
did it worked for u, for me I have to do something quite simislar like
G-ABG/KPT 1
so in this I need to concatenate it in such a way that it shows
GABGKPT1 altogether , I treied using replace function which is concatenating GABGKPT but not one. Could anyone help me in this… Replace(“-”,“”).Replace(“/”,“”).Replace(" “,”")
Please correct me.
If you are removing one type of character, the replace method is best. If you want to remove multiple, I’d recommend using regex replace.
I’m assuming you want to keep all alphanumeric characters and remove the rest. UiPath has a built-in ‘Replace’ activity (UiPath.Core.Activities.Replace), otherwise you can do it in an assign as well with the System.Text.RegularExpressions.Regex.Replace method. I will assume you’re using the built-in activity - fill in the following properties:
Input: This is the string variable you want to clean-up. Pattern: “[^a-zA-Z0-9]” - this pattern will match anything that is not an upper/lowercase character or a number RegexOption: You can leave this alone with the default settings Replacement: String.Empty Result: This is the output string that has been cleaned up. You can overwrite the same string variable you used as input, or use a completely different string variable, it’s completely up to you