【问题标题】:How to print a string with a variable in Ballerina?如何在 Ballerina 中打印带有变量的字符串?
【发布时间】:2018-11-05 07:28:23
【问题描述】:

以下代码块发生异常

string text = "foo"

string responseText = "print: " + text;

io:println(responseText);

错误:

mismatched input 'string'. expecting {'but', ';', '?', '+', '-', '*', '/', '%', '==', '!=', '>', '<', '>=', '<=', '&&', '||', '&', '^', '...', '|', '?:', '..<'}

【问题讨论】:

    标签: ballerina


    【解决方案1】:

    您缺少第一行中的分号。

    string text = "foo";
    io:println("print: " + text);
    

    【讨论】:

      猜你喜欢
      • 2021-08-05
      • 2016-01-02
      • 2019-02-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-04-07
      • 1970-01-01
      相关资源
      最近更新 更多