English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Erlang String Concat Method

Erlang String

This method merges2strings and return the concatenated string.

Syntax

concat(str1,str2)

parameter

  • str1,str2 −Need to connect2a string.

Return value

Return2concatenation of a string.

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

When we run the above program, we will get the following result.

"This is a string"

Erlang String