Which style of Ruby string quoting do you favour?

后端 未结 9 1804
挽巷
挽巷 2020-11-30 00:31

Which style of Ruby string quoting do you favour? Up until now I\'ve always used \'single quotes\' unless the string contains certain escape sequences or interp

9条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-30 01:01

    I use single quotes unless I need interpolation, or the string contains single quotes.

    However, I just learned the arbitrary delimiter trick from Dejan's answer, and I think it's great. =)

提交回复
热议问题