Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我有一个变量 dec,是否存在一种方法可以在字符串 s"a $decimal" 中指定 $dec 是变量,其余的是文字?
s"a ${dec}imal"
是这样做的方法。(每当你遇到麻烦时,只需在块内明确说明即可{}。)
{}