该方法合并2个字符串并返回串联的字符串。

concat - 语法

concat(str1,str2)
  • str1,str2   -  需要连接的2个字符串。

concat - 返回值

返回2个字符串的串联。

-module(helloLearnfk). 
-import(string,[concat/2]). 
-export([start/0]). 

start() -> 
   Str1="This is a ", 
   Str2="string", 
   Str3=concat(Str1,Str2), 
   io:fwrite("~p~n",[Str3]).

当我们运行上述程序时,我们将得到以下输出。

This is a string

参考链接

https://www.learnfk.com/erlang/erlang-concat.html