I have two lines:
"50 & 60's"
and
"50 & 60's"
and they must match.
Is there a way that I can do something for a string, maybe decode HTML before comparing?
You can use CGI :: unescapeHTML or its synonym CGI::unescape_html :
CGI::unescape_html
require 'cgi' CGI::unescape_html "50 & 60's" # => "50 & 60's"
require 'rubygems' require 'hpricot' Hpricot("50 & 60's", :xhtml_strict => true).to_plain_text # => "50 & 60's"
Source: https://habr.com/ru/post/1397621/More articles:How to determine if a particular font contains a specific character in PDF format :: API2 - fontsReturning a string from a function in C - cHow to get file name and extension when opening email attachments - androidNSURLConnection does not use default credentials - iosChanging the price of stock options at the request of users (purchase / sale) - math!! expression for boolean - javascriptGenerate fake stock price option - mathAdd URL path using htaccess - regexDebug closing in javascript - javascriptHow to hide the window that is displayed after the owner is minimized? - c #All Articles