Skip to content

StringRep

返回字符串 s 的 n 次拷贝。

Lua字符串的字节下标是从 1 开始的

业务属性

属性含义说明输入限定示例值
enable是否启用该控件,未启用时不编译是否编译选择值启用
name控件返回值命名控件输出值变量名常量repStr
text与控件关联的文本设计页控件显示常量StringRep
input输入字符串常量/流程变量#{str}
times拷贝次数常量/流程变量2

使用示例

输入常量

参数输入:abc,拷贝次数输入:3

img_24.png

输出控件返回repStrdata属性为:

json
{
  "repStr": "#{repStr}"
}
{
  "repStr": "#{repStr}"
}
img_25.png

使用curl请求接口:

$ curl http://localhost:6636/api/stringRep
$ curl http://localhost:6636/api/stringRep

接口返回:

json
{
    "repStr": "abcabcabc"
}
{
    "repStr": "abcabcabc"
}

输入指定变量

参数输入:#{body.string},拷贝次数输入:#{body.times}

img_26.png

使用curl请求接口:

$ curl http://localhost:6636/api/stringRep -d "{ \"string\": \"xyz\", \"times\": 3 }"
$ curl http://localhost:6636/api/stringRep -d "{ \"string\": \"xyz\", \"times\": 3 }"

接口返回:

json
{
    "repStr": "xyzxyzxyz"
}
{
    "repStr": "xyzxyzxyz"
}