Main Content

本页翻译不是最新的。点击此处可查看最新英文版本。

plus, +

串联字符串

自 R2021b 起

描述

示例

newStr = str1 + str2 串联字符串 str1str2

示例

newStr = plus(str1,str2) 是执行 newStr = str1 + str2 的另一种方式。

注意

要在使用 C 语言作为动作语言的 Stateflow® 图中串联字符串,请使用 strcat

示例

全部展开

串联字符串以形成 "Hello, world!"

str1 = "Hello, ";
str2 = "world!";
newStr = str1 + str2;

Stateflow chart that uses the + operator in a state.

您也可以使用 plus 来串联字符串。

str1 = "Hello, ";
str2 = "world!";
newStr = plus(str1,str2);

Stateflow chart that uses the plus operator in a state.

输入参数

全部展开

输入字符串,指定为字符串标量。用双引号将文字字符串引起来。

示例: "Hello"

限制

版本历史记录

在 R2021b 中推出