标题说明了一切;寻找与vlang中的sscanf等价的内容。
Go ( Vlang类似),有fmt.sscanf;但是我在Vlang文档中没有看到类似的东西。
我能找到的最接近的方法是在两者之间;但是,如果要从字符串中提取出许多元素,则必须连续调用它。
发布于 2022-02-06 10:54:47
在V中,不需要这种类型的函数,因为您可以使用以下语法'$var_q:$var_e'格式化字符串
这是v编译器的一个真正的代码示例。
fn run_repl(workdir string, vrepl_prefix string) {
if !is_stdin_a_pipe {
println(version.full_v_version(false))
println('Use Ctrl-C or ${term.highlight_command('exit')} to exit, or ${term.highlight_command('help')} to see other available commands')
}
// .. other repl code
}https://stackoverflow.com/questions/70545587
复制相似问题