Cookbook/Perl / List
来源:互联网 发布:淘宝链接怎么复制 编辑:程序博客网 时间:2024/06/07 08:57
Splice allows you to add, delete elements, or both, at any point in any array
# splice 从列表中切除元素, 列表值会发生改变# 表示从最后一个元素往回切 6 个元素, 如果超过列表大小,会提示: # Modification of non-creatable array value attemptesplice(@array, 0, 3) # 切除 0 , 1, 2, 3 四个元素map say, splice(@array, -6)
To add some elements :
splice(@array, 2) # will remove all the elements from $array[2] to the end of the list
splice (expr, offset, length, list) : removes the elements designated by “offset” and “length” from an array, and replace them with the elements of list
e.g.,
my @array = (0, 1, 2, 3, 4, 5) ; splice(@array, @array - 3, 1, 6, 7) ; # will remove 3 and push 6, 7 between 2 and 4 splice(@array, $i, 1, $y) # == $array[$i] = $y
“`
0 0
- Cookbook/Perl / List
- Perl modules List
- Cookbook
- cookbook
- Learning Perl: 3.3. List Literals
- Learning Perl: 3.4. List Assignment
- php perl 的list比较
- List and Array in Perl
- Perl Learning 2 List&Array
- Learning Perl: 3.7. Scalar and List Context
- Learning Perl: 3.8. in List Context
- Learning Perl: 9.4. m// in List Context
- scalar and list context in Perl
- Perl中列用工具List模块
- perl核心模块解析(二)List
- perl两个模块: List::Util和List::MoreUtils
- perl
- Perl
- Java反射机制实践
- ListView局部刷新
- 《iOS Human Interface Guidelines》——HealthKit
- TabLayout的使用
- 移动产品的首次邂逅
- Cookbook/Perl / List
- 通过sqlserver日志恢复误删除的数据
- Tomcat内存溢出(java.lang.OutOfMemoryError: PermGen space)的解决办法
- Android设备修改host文件以及修改设备网关
- 将Excel数据快速大批量导入数据库
- 菜鸟开发之路 ---okhttp的简单封装
- ThreadLocal的内存泄漏问题
- Java学习笔记(67)-----------Timer和TimerTask
- 【opencv】播放视频