I am facing a similar problem where we have to compare two strings. I applied the regex to match it and it works fine for the string which dont have space between. However in case the matching string containg space, then its failing.

Please let me know how to tackle this.

Thanks in advance.

Member Avatar for b1izzard
irb(main):001:0> a="hello Ruby"
=> "hello Ruby"
irb(main):002:0> b="hello Rails"
=> "hello Rails"
irb(main):003:0> c="hello Ruby"
=> "hello Ruby"
irb(main):004:0> a.eql?(b)
=> false
irb(main):005:0> a.eql?(c)
=> true
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.