gpt4 book ai didi

javascript - 像 Python 一样的 NodeJS 字符串格式?

转载 作者:IT老高 更新时间:2023-10-28 23:19:29 25 4
gpt4 key购买 nike

在python中,我可以做到以下几点:

name = "bob"

print("Hey, %s!" % name)

在 JavaScript/NodeJS 中是否有类似的东西(或 Python 的 .format())?

最佳答案

您可以使用 util.format ,它是 printf 之类的函数。

关于javascript - 像 Python 一样的 NodeJS 字符串格式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10788408/

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