如何在 Swig 上连接两个字符串?

问题描述 投票:0回答:2

我试图将一个变量与另一个字符串连接起来,但失败了。到目前为止我尝试过这些事情但失败了。

{{name~' Leon'}} and {{name+' Leon'}}

记住我是想用大口的口气而不是小树枝来做到这一点。

swig-template
2个回答
0
投票

你能做到这样吗?

{{ name }} Leon

0
投票

SWIG 本身带有一个宏(在

typemaps/fragments.swg
中)

#define %fragment_name(Name, Type...)     %string_name(Name) "_" {Type}

也许你可以尝试类似的东西。

© www.soinside.com 2019 - 2024. All rights reserved.