String Manipulation. Need to delete some charater from string which is in start and some from end. String is dynamic

Below is the string
"Enter closeout notes 06-08-2023Budi Silalahi -Arrived at site DLV2 -Sign in RME in the building with Michael-JHA Completed --Setup a safety barrier with caution cone Pearce Wo 01783457Case number 579989Check in with Sarah -station ID 122289C-Parking stall 125-On site charger offline upon arrival -Found charger and circuit panel-Checked app found charger is offline -Power cycled Charger. Waited to let charger Reset. -Checked LED light found all are all on-Checked App, charger is back online.-Test charger with L2 tester & ev vehicle -check out with Evelyn -case resolved -Clean work area -Wipe down charger -Label photos and finish report.Edit Closeout NotesCompleted by Budi Silalahi on 6/8/2023 at 9:39 PM(PDT"

Above string is dynamic it change for other record. I want to delete the bold character from string and it work for other upcoming string also.

@Puneet_Singh1

You can use the Assign activity like this:

strContent = System.Text.RegularExpressions.Regex.Match(strContent, "(?<=(Enter closeout notes )).+(?=Edit Closeout Notes)").ToString

Where strContent is the variable name with the whole original string

Thank you so much this is working…Need one thing more sorry forgot to mention if any dates comes how to remove that from string.

Can you illustrate or give an example?

06-08-2023Budi Silalahi -Arrived at site DLV2 -Sign in RME in the building with Michael-JHA Completed --Setup a safety barrier with caution cone Pearce Wo 01783457Case number 579989Check in with Sarah -station ID 122289C-Parking stall 125-On site charger offline upon arrival -Found charger and circuit panel-Checked app found charger is offline -Power cycled Charger. Waited to let charger Reset. -Checked LED light found all are all on-Checked App, charger is back online.-Test charger with L2 tester & ev vehicle -check out with Evelyn -case resolved -Clean work area -Wipe down charger -Label photos and finish report.

In that case, do another Assign activity after the first one and use this code this time:

System.Text.RegularExpressions.Regex.Match(strContent, "(?<=(\d{2}-\d{2}-\d{4})).+").ToString

Thanks!

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