hotmailisforloosers
Programmer
I have two strings side by side that compare to eachother and highlight the differences (one is a modified version of the other).
I am comparing by sentence right now (thanks to a suggestion that I split it up by the periods). My problem is that if there is a sentence inserted or deleted from the string then it throws the whole thing out of wack. It compares each array item in order, so when a new one is added, all the rest are thrown off.
So I've been thinking about how to accomplish this, and I decided to try and read the difference between the arrays, then use that difference to jump forward or back to try and find a sentence that matches. I've been finding it almost impossible to put this into practice though, with the array going out of bounds every time I try and test even the smallest thing.
I'm going to keep plugging at this from that angle, but since I am a pretty new programmer I was wondering if a wise old vet might know a better way of handling this problem.... or could maybe even show me how to put my own logic into practice
Thanks!
I am comparing by sentence right now (thanks to a suggestion that I split it up by the periods). My problem is that if there is a sentence inserted or deleted from the string then it throws the whole thing out of wack. It compares each array item in order, so when a new one is added, all the rest are thrown off.
So I've been thinking about how to accomplish this, and I decided to try and read the difference between the arrays, then use that difference to jump forward or back to try and find a sentence that matches. I've been finding it almost impossible to put this into practice though, with the array going out of bounds every time I try and test even the smallest thing.
I'm going to keep plugging at this from that angle, but since I am a pretty new programmer I was wondering if a wise old vet might know a better way of handling this problem.... or could maybe even show me how to put my own logic into practice
Thanks!