gpt4 book ai didi

ruby - ruby 中的 %Q 和 %{} 有什么区别?

转载 作者:数据小太阳 更新时间:2023-10-29 06:55:56 26 4
gpt4 key购买 nike

Ruby 中 %Q 和 %{} 的语义是什么?它们有什么区别?

最佳答案

Jim Hoskins清除它。

%Q is the equivalent to a double-quoted ruby string. #{expression} evaluation works just like in double-quoted strings, even if you use %Q{} as your delimiter!

You can also leave off the Q and it will have the same functionality. I recommend leaving the Q in to be more clear.

关于ruby - ruby 中的 %Q 和 %{} 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1273813/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com