该方法返回元组中的第N th 元素。
element - 语法
element(N,Tuple)
N - 元组中需要返回的位置。
Tuple - 需要为其返回第N 元素的元组。
element - 返回值
该方法返回元组中的第N th 元素。
-module(helloLearnfk). -export([start/0]).start() -> io:fwrite("
pn",[element(2, {a, b, c})]).
当我们运行上述程序时,我们将得到以下输出。
b
该方法返回元组中的第N th 元素。
element(N,Tuple)
N - 元组中需要返回的位置。
Tuple - 需要为其返回第N 元素的元组。
该方法返回元组中的第N th 元素。
-module(helloLearnfk). -export([start/0]).start() -> io:fwrite("
pn",[element(2, {a, b, c})]).
当我们运行上述程序时,我们将得到以下输出。
b