From: Priyank Shah on 31 Jul 2010 01:11 Priyank Shah 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 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 -- Posted via http://www.ruby-forum.com/.
From: Intransition on 31 Jul 2010 02:10
On Jul 31, 1:11 am, Priyank Shah <shahpriyan...(a)gmail.com> wrote: > Priyank Shah 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 > > http://codeidol.com/other/rubyckbk/Files-and-Directories/Comparing-Tw... > > 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. As in: @b.split(//) - @a.split(//) ? |