【问题标题】:Get the second string in util.format获取 util.format 中的第二个字符串
【发布时间】:2022-12-13 09:26:28
【问题描述】:

我希望这段代码返回第二个字符串,而不是第一个:

const util = require('util');
util.format('%s', 'foo', 'bar');

这将返回“foo”。

您可以打印第二个字符串而无需执行 '%s %x',它会打印这两个字符串。我只想要第二个。我该怎么做?

【问题讨论】:

  • util.format('%c%s', 'foo', 'bar')

标签: node.js


【解决方案1】:
util.format('%c%s', 'foo', 'bar')

【讨论】:

    猜你喜欢
    • 2021-02-10
    • 1970-01-01
    • 2014-06-08
    • 1970-01-01
    • 1970-01-01
    • 2017-05-06
    • 2015-01-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多