Home > Blockchain >  How to convert String to Literal Text in Rails
How to convert String to Literal Text in Rails

Time:09-30

I am new in ruby on rails and I am trying to convert string to literal text. I tried everything but still facing this issue which is halting my work.

For instance, I've this string

"08:3a:88:32:e1:2a,b0:4f:13:10:00:d6,08:3a:88:32:d5:79"

which I want like this in rails

08:3a:88:32:e1:2a,b0:4f:13:10:00:d6,08:3a:88:32:d5:79

CodePudding user response:

For what would you need it? I guess you can receive better help if you can present a small example where it fails with quotes.

Strings are presented with quotes, as soon as you print them out the quotes disappear.

example_string = "08:3a:88:32:e1:2a,b0:4f:13:10:00:d6,08:3a:88:32:d5:79"
puts example_string # => 08:3a:88:32:e1:2a,b0:4f:13:10:00:d6,08:3a:88:32:d5:79
<%= example_string %> # => 08:3a:88:32:e1:2a,b0:4f:13:10:00:d6,08:3a:88:32:d5:79
  • Related