Compare Two Strings

  • Thread starter Thread starter Twinkle
  • Start date Start date
T

Twinkle

HI there
i want to compare between two strings char by char.every
strings having a word document.first string name is strFileName and
second string name is strFilename1.
i want to compare strFileName with strFileName1.if there is any mistek
or some word is missing in second string then that words should be
highlight(in sense change the color of that words) by the button click
event.
pls somebody give an idea to me.

Twinkle
 
Hi Twinkle,

I'm not sure what you are asking for.

Do you have two almost identical strings and want to mark the differences (like comparing a document with its older version)? Or do you have mean string1 is a list of words that should occur at least once in string2, and mark missing words?

When you mean highlight missing words, what do you mean? Strings can't be highlighted, but you can add codes that will cause words to be highlighted when displayed in various ways. How to highlight a word very much depends on what you display it with.

If string1 is "Hello World." and string2 is "Hello. How are you." What do you expect to happen?
 
HI Mortan
u got something right.i explain that
first string strFileName having a word document and second
strFileName1 having html document.in this html file some data of
word file is existing.like if strFilename have "Hello World" and
strFileName1 also have "Hello World" like this
now i have to compare these two string.if i select "Hello world" in
first string and click button then if any word of "Hello World" missing
in second string(like "Hello Word") then it will be displayed
highlight.L is missing then L should be marked in second string

That's it..plz help me if u know about it
Twinkle
 
I don't think this can be solved easily. For instance, how do you find the proper Hello World in each document.

To begin with, you need to find out how to parse the document and the html file and extract only the text. You could then do a character by character comparison and write a third string as you go with missing characters and color codes.


HI Mortan
u got something right.i explain that
first string strFileName having a word document and second
strFileName1 having html document.in this html file some data of
word file is existing.like if strFilename have "Hello World" and
strFileName1 also have "Hello World" like this
now i have to compare these two string.if i select "Hello world" in
first string and click button then if any word of "Hello World" missing
in second string(like "Hello Word") then it will be displayed
highlight.L is missing then L should be marked in second string

That's it..plz help me if u know about it
Twinkle
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top