Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing strings --- inserted sentences

Status
Not open for further replies.

hotmailisforloosers

Programmer
Jun 22, 2004
25
0
0
US
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!
 
Thanks, I'll check it out.

... I know, it's a bad joke. That's the username to my hotmail account....... a little dorky self-deprecating humor because I couldn't get anything else to take as a username. I'm not uneducated... just a freak :)
 
Thanks, I'm thinking this task is pretty advanced for an intern.... I've made some decent progress on it, but it's getting to the point where I can't hold it all together in my brain........ especially with what you just showed me... ouch, it hurts.

So I'll probably end up screaming to my co-workers for help. I think they were expecting a little much from me, or simply didn't realize all that this would entail.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top