String oldStr = "aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa bbb bbb bbb bbb";
String newStr = "bbb bbb bbb bbb ccc ccc ccc ccc ccc ccc ccc";
How do I find what part of string in newStr already exists in oldStr. I need to be able to separate new Str as below:
String newStrExistingContent = "bbb bbb bbb bbb";
String newStrNewContent = "ccc ccc ccc ccc ccc ccc ccc";
Edit: Let me make it more clear.
No part of old or new str are known. User clicks a button n logs are displayed. User does some action on application, and clicks button again, and logs are displayed again. What I am trying to do is to show new lines added to log in a didifferent color.
I hope this explanation helps.