In Ruby on Rails,I got a string number is made of 3 parts : prefix , counter , suffix
In model Setup:
def self.number
prefix = setup.receipt_prefix.blank? ? "" : setup.receipt_prefix.to_s
counter = setup.receipt_counter.blank? ? "" : setup.receipt_counter+1
suffix = setup.receipt_suffix.blank? ? "" : setup.receipt_suffix.to_s
each individual string shows fine:
puts prefix
=> \#_
puts counter
=> 1234
puts suffix
=> #$@s
but when I add 3 string together, an addition back slash appear :
prefix + counter + suffix
=> \\#_1234\#$@s
how can I escape "#" "\" when I add 3 string together ? like
=> \#_1234#$@s
any Ruby or Rails's helper I can use in the model? thx~~