Erlang - concat

Il metodo concatena 2 stringhe e restituisce la stringa concatenata.

Sintassi

concat(str1,str2)

Parametri

  • str1,str2 - Le 2 stringhe che devono essere concatenate.

Valore di ritorno

Restituisce la concatenazione delle 2 stringhe.

Per esempio

-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]).

Produzione

Quando eseguiamo il programma sopra, otterremo il seguente risultato.

“This is a string”