Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Erlang str

-module(helloworld). 
-import(string,[str/2]). 
-export([start/0]). 

start() -> 
Str1 = "hello World", 
Index1 = str(Str1,"hello"), 
io:fwrite("~p~n",[Index1]).

Erlang chr

-module(helloworld). 
-import(string,[chr/2]). 
-export([start/0]). 

start() -> 
   Str1 = "hello World", 
   Index1 = chr(Str1,$e), 
   io:fwrite("~p~n",[Index1]).

Erlang concat

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

Erlang - right Return Value

-module(helloworld). 
-import(string,[right/2]). 
-export([start/0]). 

start() -> 
   Str1 = "hello World", 
   Str2 = right(Str1,2), 
   io:fwrite("~p~n",[Str2]).

Erlang Equal Strings

-module(helloworld). 
-import(string,[equal/2]). 
-export([start/0]). 

start() -> 
   Str1 = "This is a string1", 
   Str2 = "This is a string2", 
   Status = equal(Str1,Str2), 
   io:fwrite("~p~n",[Status]).

Erlang Len Strings

-module(helloworld). 
-import(string,[len/1]). 
-export([start/0]). 

start() -> 
   Str1 = "This is a string1", 
   Len1 = len(Str1), 
   io:fwrite("~p~n",[Len1]).

Erlang Strings

-module(helloworld). 
-export([start/0]). 

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

Erlang Is_Integer

-module(helloworld). 
-export([start/0]). 

start() ->
   Num = 3, 
   io:fwrite("~w",[is_integer(Num)]).

Erlang Is_float

-module(helloworld). 
-export([start/0]). 

start() ->
   Num = 3.00, 
   io:fwrite("~w",[is_float(Num)]).

Erlang float

-module(helloworld). 
-export([start/0]). 

start() ->
   Num = float(3), 
   io:fwrite("~f",[Num]).

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.