这里会显示出您选择的修订版和当前版本之间的差别。
api:easp.list.shift [2018/08/15 08:51] |
api:easp.list.shift [2018/08/15 08:51] (当前版本) |
||
---|---|---|---|
行 1: | 行 1: | ||
+ | ===== Easp.List.Shift 方法 ===== | ||
+ | 删除数组的第一个元素 | ||
+ | ==== 语法 ==== | ||
+ | <sxh asp> | ||
+ | Easp.List.Shift | ||
+ | Easp.List.Shift_ | ||
+ | </sxh> | ||
+ | ==== 返回值 ==== | ||
+ | ><wrap em>下列返回值仅 ''Easp.List.Shift_'' 方法</wrap> | ||
+ | |//**Object **//|<wrap lo>ASP对象</wrap>| | ||
+ | |:::| 返回一个新的Easp的List对象,原List对象不受影响。| | ||
+ | ==== 注释 ==== | ||
+ | 使用该方法可以删除数组的第一个元素。\\ | ||
+ | ><wrap em>使用 ''Easp.List.Shift_'' 方法可以删除数组的第一个元素,剩下的元素组成新的数组对象,不改变原数组的数据。</wrap> | ||
+ | ==== 示例 ==== | ||
+ | <sxh asp;title:demo1.asp> | ||
+ | '创建一个List对象 | ||
+ | Set list = Easp.List.New | ||
+ | '设置为普通数组并赋值 | ||
+ | list.Data = "zero:零 one:壹 two:贰 three:叁" | ||
+ | '删除第一个元素 | ||
+ | list.Shift | ||
+ | '输出 | ||
+ | Easp.W list.ToString | ||
+ | </sxh> | ||
+ | 本示例运行结果为:\\ | ||
+ | <sxh> | ||
+ | one:壹,two:贰,three:叁 | ||
+ | </sxh> | ||
+ | <sxh asp;title:demo2.asp> | ||
+ | '创建一个List对象 | ||
+ | Set list = Easp.List.New | ||
+ | '设置为普通数组并赋值 | ||
+ | list.Data = "zero:零 one:壹 two:贰 three:叁" | ||
+ | '输出 | ||
+ | Easp.WN "新数组:" & list.Shift_.ToString | ||
+ | Easp.WN "原数组:" & list.ToString | ||
+ | </sxh> | ||
+ | 本示例运行结果为:\\ | ||
+ | <sxh> | ||
+ | 新数组:one:壹,two:贰,three:叁 | ||
+ | 原数组:zero:零,one:壹,two:贰,three:叁 | ||
+ | </sxh> |