![](/img/trans.png)
[英]How to add prefix and remove double quotes from the value in ruby on rails?
[英]how Remove double quotes from a string ruby on rails?
如何从轨道上的字符串红宝石中删除双引号? 我有一个像这样的字符串:
"5,5"
转换逻辑:
@a = @cart_id.chomp(',')
abort @a.inspect
str = 'hello " 5," world'
str.gsub!('"', '')
puts str #hello 5, world
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.