The method returns the length of a particular string
str − This is the string for which the number of characters need to be determined.
The return value is the number of characters in the string.
-module(helloworld). -import(string,[len/1]). -export([start/0]). start() -> Str1 = "This is a string1", Len1 = len(Str1), io:fwrite("~p~n",[Len1]).
When we run the above program, we will get the following result.