gpt4 book ai didi

syntax - 如何在 Elixir 中进行换行(换行)?

转载 作者:行者123 更新时间:2023-12-03 20:16:30 26 4
gpt4 key购买 nike

例如,在 Python 中,可以用 '\' 字符换行(是的,必要的邪恶)。是否可以在 Elixir 中断行?

最佳答案

Elixir 不像 Python 那样对空格敏感,因此您可以执行以下操作:

a =
2 + 4 +
3
# a is bound to 9

如果你想打破字符串,最好的办法可能是每行连接一个字符串:
"this is a very long string that " <>
"spans multiple lines because man, " <>
"is it long"

关于syntax - 如何在 Elixir 中进行换行(换行)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29030309/

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