Hi there, apologies if this is a dumb question, I’m quite new to UiPath still!
I have an issue where a value is being input into a database, but the full text isn’t required and so I need to split it. So, or example, we may have a customer name as:
“Steve Smith T/A Smith’s Hotdogs” - we only want ‘Smith’s Hotdogs’ in this instance.
I’ve input an If activity to say ‘if the customer name contains T/A…’
The problem is, I don’t know how to write the code, as it shows as follows:
How would I change this to only include the text after the T/A (removing white spaces before and after also)?
Thanks for your help!
Please find the below…
Hope this helps
Substring can also help
Thank you for your help with this.
Just a thought also: if I add .ToLower to this, it will add everything in lower case, will it not? I just thought that if on the JSON it appears as ‘t/a’ rather than ‘T/A’ that it may not pick it up?
Damn ppr, you always are around with these tips
Feel free to add
.ToLower which helps for your scenario.
Also please make sure you use lower case inside split separator string.
For the case insensitive way we can think on:
var parts = Regex.Split(iJsonObject(“CustomerName”).ToString, "t/a", RegexOptions.IgnoreCase).Last()
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.