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
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
One method, and I stress this is only one method, is the Levenshtein
distance at
http://en.wikibooks.org/wiki/Algorithm_implementation/Strings/Levenshtein_distance#Ruby
and it has code, in ruby!
On Jul 30, 9:17 am, Priyank S. [email protected] wrote:
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.
There is strmask (http://rubyworks.github.com/strmask/)
Also the Levenshtein distance is String#edit_distance in Ruby F.s.
On Fri, Jul 30, 2010 at 8:17 AM, Priyank S.
[email protected]wrote:
Please let me know if any one know.
Thanks in advance
PriyankPosted via http://www.ruby-forum.com/.
“Difference” in this case does not seem very well defined.
i want difference like user know which diffrence on which character.
There’s a “differ” gem which could be useful for you.
Gavin
Priyank S. wrote:
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
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 S.
On Jul 31, 1:11 am, Priyank S. [email protected] wrote:
and it just shows me number of differences.
So if you have any idea regarding this then please suggest.
As in:
@b.split(//) - @a.split(//)
?
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs