Erlang-concat



該方法連線 2 個字串並返回連線後的字串。

語法

concat(str1,str2)

引數

  • str1,str2 − 需要連線的 2 個字串。

返回值

返回 2 個字串的連線。

例如

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

輸出

當我們執行上述程式時,將獲得以下結果。

“This is a string”
strings.htm
廣告
© . All rights reserved.