Erlang - concat
La méthode concatène 2 chaînes et renvoie la chaîne concaténée.
Syntaxe
concat(str1,str2)
Paramètres
str1,str2 - Les 2 chaînes qui doivent être concaténées.
Valeur de retour
Renvoie la concaténation des 2 chaînes.
Par exemple
-module(helloworld).
-import(string,[concat/2]).
-export([start/0]).
start() ->
Str1 = "This is a ",
Str2 = "string",
Str3 = concat(Str1,Str2),
io:fwrite("~p~n",[Str3]).
Production
Lorsque nous exécutons le programme ci-dessus, nous obtiendrons le résultat suivant.
“This is a string”