how to find difference between two strings

P

Priyank Shah

Hi,

I have two strings, like
@a = "hello"
@b = "h123llo"

so in that how can i print diffrence?

i want difference like user know which diffrence on which character.

Please let me know if any one know.

Thanks in advance
Priyank
 
J

Josh Cheek

[Note: parts of this message were removed to make it a legal post.]

Hi,

I have two strings, like
@a = "hello"
@b = "h123llo"

so in that how can i print diffrence?

i want difference like user know which diffrence on which character.

Please let me know if any one know.

Thanks in advance
Priyank
"Difference" in this case does not seem very well defined.
 
P

Priyank Shah

Priyank said:
Hi,

I have two strings, like
@a = "hello"
@b = "h123llo"

so in that how can i print diffrence?

i want difference like user know which diffrence on which character.

Please let me know if any one know.

Thanks in advance
Priyank



Thanks to you all but i want difference so i used

http://codeidol.com/other/rubyckbk/Files-and-Directories/Comparing-Two-Files/

And its working fine but i actully want exact difference.

and it just shows me number of differences.

So if you have any idea regarding this then please suggest.

Thanks,
Priyank Shah
 

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

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top