@theandouz, I realize that if you are not familiar with JavaScript and JXA, then that might not be as simple as I implied.
So, here's a complete Macro that performs this task.
You can use the JXA script it contains as a reusable script. All you need to do is set a KM Variable "Local__SourceStr" to your data, and call the script.