English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
该方法根据字符数从字符串的左侧返回子字符串。
left(str1,number)
str1 −这是需要从中提取子字符串的字符串。
Number −这是子字符串中需要出现的字符数。
根据字符串的左侧和数字,从原始字符串返回子字符串。
-module(helloworld). -import(string,[left/2 -export([start/0]). start() -> Str1 = "hello World", Str2 = left(Str1,2), io:fwrite("~p~n",[Str2
Cuando ejecutamos el programa anterior, obtendremos el siguiente resultado.
"he"