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