My intention is to Update a String A with a String B.
These strings have a few lines(with "\n") and I want to keep the whole String A and just add the differences from String B
For example:
I would start by breaking the two strings into arrays. In your example there would be 5 entries in each array. Then I would write some code which went through the two arrays and did the updating which you require. And finally I would convert the updated array back to a string.