I am trying to find a way, how to compare two strings and upgrade the first, when the second has more in it. For example
String A="This is a statement!"; String B="This is a statement! Good luck!"; if(A<B{ //B has more letters //Upgrade A } else{ //Upgrade B }
I mean with upgrade not overwriting like A=B. My strings has usually much lines. I want to keep the value of the string and just insert the new things from the other String. Has someone an idea?
EDIT: Thank you for the nice answers. Unfortunetly I didnt exlain it more clear, sorry my fault. My problem is, that I do now know where the changes are, the strings could look like this:
String A:
A
B
C//Good morning, sir
D//A comment
E
String B:
A
B//Yes
C
D
DD
E
The result should be:
A
B//Yes
C//Good morning, sir
D//A comment
DD
E
<will most likely compare the lexical ordering.