String manipulation

I have a string in a table containing a list of serial numbers; this list could be a list of 1 or >1. I will need to develop functionality to find a particular serial number and remove it from the list while keeping the integrity of the comma delineator. This will be very easy if the list contains 1 SN, but I am unsure how to achieve this if the qty is >1. Any help or guidance would be greatly appreciated.

Example string:

AA4B109210101, AA4B109210102, AA4B109210103, AA4B109210104

SN to remove – case 1:

AA4B109210103

New string – case 1:

AA4B109210101, AA4B109210102, AA4B109210104

SN to remove – case 2:

AA4B109210101

New string – case 2:

AA4B109210102, AA4B109210103, AA4B109210104

SN to remove – case 3:

AA4B109210104

New string – case 3:

AA4B109210101, AA4B109210102, AA4B109210103

Hi @RDuke,

if it is always the same pattern (Komma and Space) here is one possible way with TULIP Expressions:

The Button Trigger does:

However, it might be a better solution to manipulate the “removeFromList” and the “listBefore” strings before by adding a ", " at the beginning and the end, then substitute and trim the ", " at the ends again.
That makes sure, you only substitute complete Serial Numbers…

like so:

2 Likes

Thank you for your quick response, this is exactly what I was looking for!

1 Like