Main Content

La traduzione di questa pagina non è aggiornata. Fai clic qui per vedere l'ultima versione in inglese.

plus, +

Concatenare le stringhe

Da R2021b

Descrizione

esempio

newStr = str1 + str2 concatena le stringhe str1 e str2.

esempio

newStr = plus(str1,str2) è un metodo alternativo per eseguire newStr = str1 + str2.

Nota

Per concatenare le stringhe nei grafici Stateflow® che utilizzano C come linguaggio di azione, utilizzare strcat.

Esempi

espandi tutto

Concatenare le stringhe per formare "Hello, world!".

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

Stateflow chart that uses the + operator in a state.

In alternativa, è possibile utilizzare plus per concatenare le stringhe.

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

Stateflow chart that uses the plus operator in a state.

Argomenti di input

espandi tutto

Stringhe di input, specificate come scalare di stringa. Racchiudere la stringa letterale con doppi apici.

Esempio "Hello"

Limiti

Cronologia versioni

Introdotto in R2021b