Is there an elegant regex-way with Ruby to replace all occurrences of °C to °F in a string (while at the same time converting the units)? For example:
“Today it is 25°C and tomorrow 27 °C.”
should result in something like:
“Today it is 77°F and tomorrow 81 °F.”
1 Answer