stringArrayAddPrefix
在数组里的每个组件前加内容
MEL examples
stringArrayAddPrefix( { “a”, “b”, “c” }, “>” );
,Result:, >a >b >c //

stringArrayAddPrefix( { “a”, “b”, “c” }, “___” );
,Result:, ___a ___b ___c //

string $objs[] = { “a”, “b”, “c” };
stringArrayAddPrefix( $objs, “***” );
print $objs;
***a
***b
***c
stringArrayCatenate
将2个数组合并成1个数组
string $string1[] = {“light1”, “light2”};
string string2[]="light3","light4","light5";stringArrayCatenate(string2[] = {"light3","light4","light5"}; stringArrayCatenate(string2[]="light3","light4","light5";stringArrayCatenate(string1, $string2);
// Result: light1 light2 light3 light4 light5 //
stringArrayContains
判断数组里有没有包含弄个组件

string $array1[] = {“item1”, “item2”, “item1”};
// Result: item1 item2 item1 //
int $found = stringArrayContains(“item1”, $array1);
// Result: 1 //
$count = stringArrayContains(“item2”, $array1);
// Result: 1 //
$count = stringArrayContains(“plotz”, $array1);
// Result: 0 //
stringArrayCount
判断数组里有多少个相同的组件

string $array1[] = {“item1”, “item2”, “item1”};
// Result: item1 item2 item1 //
int $count = stringArrayCount(“item1”, $array1);
// Result: 2 //数组里有2个item1
$count = stringArrayCount(“item2”, $array1);
// Result: 1 //
$count = stringArrayCount(“plotz”, $array1);
// Result: 0 //
stringArrayFind
在数组里查找某个组件是从数组里的哪一位开始的

string $array[] = { “item1”, “item2”, “item3” };
// Result: item1 item2 item3 //
int $index = stringArrayFind( “item1”, 0, $array );从第一位的组件开始搜索item1
// Result: 0 //
$index = stringArrayFind( “item1”, 1, $array );如果是从第二位开始搜,那item1就处于-1的位置上
// Result: -1 //
$index = stringArrayFind( “item3”, 4, $array );
// Result: -1 //
$index = stringArrayFind( “blah”, 0, $array );如果数组里没有这个组件 也返回的是-1
// Result: -1 //
stringArrayInsertAtIndex
将新的组件添加到数组中

// Initialize the list
string $list[] = {“item1”, “item3”};
// Result: item1 item3 //
// Insert in the middle of the sequence
stringArrayInsertAtIndex(1, $list, “item2”);
在第2位的位置上添加新组件 item2
// Result: 1 //
print $list;
// Result: item1 item2 item3 //
// Insert before the first element
stringArrayInsertAtIndex(-1, $list, “item4” );
// Result: 0 //
// Insert at (or after) the end of the sequence
stringArrayInsertAtIndex( 10, $list, “item4” );
如果设置的位置大于当前数组的数量,则排在最后
// Result: 1 //
print $list;
// Result: item1 item2 item3 item4 //
// Insert at the beginning of the sequence
stringArrayInsertAtIndex( 0, $list, “item0” );
// Result: 1 //
print $list;
// Result: item0 item1 item2 item3 item4 //
stringArrayIntersector
获取2个数组中相同的组件

string $myIntersector = stringArrayIntersector;
string $initialArrayA[] = {“aa”, “bb”, “cc”};
string $initialArrayB[] = {“cc”, “dd”, “ff”};
stringArrayIntersector -edit -intersect $initialArrayA $myIntersector;
stringArrayIntersector -edit -intersect $initialArrayB $myIntersector;
stringArrayIntersector -query $myIntersector;
// Result: cc //
stringArrayRemove
移除数组的组件

string $list[] = { “a”, “b”, “c”, “d”, “b”, “e”, “f”, “a”, “g” };
string $items[] = { “a”, “c”, “e”, “g” };
string diff[]=stringArrayRemove(diff[] = stringArrayRemove(diff[]=stringArrayRemove(items, $list);
// Result : { b, d, b, f } //
stringArrayRemoveAtIndex
按位置删除组件

string $array1[] = {“item1”, “item2”, “item3”};
// Result: item1 item2 item1 //
stringArrayRemoveAtIndex(1, $array1);
// Result: 1 //删除 $array1里的第二个组件
print $array1;
// Result: item1 item3 //
stringArrayRemoveDuplicates
移除数组中相同的组件

string $list[] = { “d”, “b”, “c”, “c”, “a”, “a”, “b” };
string shorterList[]=stringArrayRemoveDuplicates(shorterList[] = stringArrayRemoveDuplicates(shorterList[]=stringArrayRemoveDuplicates(list);
// Result : { d, b, c, a } //
stringArrayRemoveExact
删除数组里存在的组件

string $list[] = { “a”, “b”, “a”, “a”, “c” };
string $itemsToRemove[] = { “a”, “c”, “a” };
string diff[]=stringArrayRemoveExact(diff[] = stringArrayRemoveExact(diff[]=stringArrayRemoveExact(itemsToRemove, $list);
// Result : { b, a } //
stringArrayRemovePrefix
移除组件中内容

stringArrayRemovePrefix( { “***a”, “***b”, “***c” }, “***” );
// ,Result:, a b c //

stringArrayRemovePrefix( { “***a”, “+++b”, “—c” }, “***” );
// ,Result:, a +++b —c //

stringArrayRemovePrefix( { “***a”, “”, “—c” }, “***” );
// ,Result:, a —c //
stringArrayToString
将数组变成字符串

stringArrayToString({ “red”, “blue”, “green” }, “”);
// Result: redbluegreen //

stringArrayToString({ "red", "blue", "green" }, ", ");
// Result: red, blue, green //stringArrayToString({ "user", "directory", "documents", "file" }, "/");
// Result: user/directory/documents/file //
**stringToStringArray
将字符串变成数组**
string $array[];$array = stringToStringArray("red blue green", " ");
print ("// " + $array[0] + "\n");
print ("// " + $array[1] + "\n");
print ("// " + $array[2] + "\n");
// red
// blue
// green$array = stringToStringArray("Hey, what's your name?", " ,?");
print ("// " + $array[0] + "\n");
print ("// " + $array[1] + "\n");
print ("// " + $array[2] + "\n");
print ("// " + $array[3] + "\n");
// Hey
// what's
// your
// name$array = stringToStringArray("/user/directory/documents/file", "/");
print ("// " + $array[0] + "\n");
print ("// " + $array[1] + "\n");
print ("// " + $array[2] + "\n");
print ("// " + $array[3] + "\n");
// user
// directory
// documents
// file

Maya Mel 数组相关代码笔记相关推荐

  1. maya脚本用python还是mel_将vim中的mel和python代码直接发送到Maya里

    相信不管你用什么编辑器,能直接把代码发送到Maya里并执行是十分方便的功能. 要在vim里实现这个功能,你只要安装一个插件就行,但必须的准备工作还是要的. 首先,你需要一个支持python的vim,官 ...

  2. ffmpeg中的http协议相关代码阅读笔记

    ffmpeg中的http协议相关代码阅读笔记 今天闲来无事,尝试看了下ffmpeg中的相关http协议传输处理代码 先简单说下这个代码在整个仓库里面的位置: ffmpeg/libavformat/ht ...

  3. 基于骨骼关键点的动作识别(OpenMMlab学习笔记,附PYSKL相关代码演示)

    一.骨骼动作识别 骨骼动作识别是视频理解领域的一项任务 1.1 视频数据的多种模态 RGB:使用最广,包含信息最多,从RGB可以得到Flow.Skeleton.但是处理需要较大的计算量 Flow:光流 ...

  4. 论文笔记——Deep Residual Learning for Image Recognition(论文及相关代码)

    啊先说一些题外话,在刚刚进入深度学习的时候就在知乎上看到关于何恺明大神的phd的传奇经历.大概就是何大牛顶着光环选手的称号进的MSRA,peer的到第1-2年就已经各种论文刷到飞起,但是何大牛到第三年 ...

  5. MATLAB中的结构体数组(struct)学习笔记

    不要失却热情,不要丢掉冠军的心! MALAB中的结构体(struct)数组学习笔记 前言 1. 版本 2. 关键词 一.Struct结构体数组概述 二.Struct结构体数组基本用法 1. 结构体的创 ...

  6. 【C 语言】数组 ( 数组相关地址 | 数组首元素地址 | 数组地址 )

    文章目录 一.数组相关地址 1.数组首元素地址 2.数组地址 二.代码示例 一.数组相关地址 数组首元素地址 与 数组地址 值相等 ; int array[10]; 其中 array + 1 的值是 ...

  7. 【Android 安全】DEX 加密 ( Java 工具开发 | 解压 apk 文件 | 加密生成 dex 文件 | 打包未签名 apk 文件 | 文件解压缩相关代码 )

    文章目录 一.解压 apk 文件 二.加密生成 dex 文件 三.打包未签名 apk 文件 四.完整代码示例 五.文件解压缩相关代码 六.执行结果 参考博客 : [Android 安全]DEX 加密 ...

  8. boost::multi_array模块实现打印数组相关的测试程序

    boost::multi_array模块实现打印数组相关的测试程序 实现功能 C++实现代码 实现功能 boost::multi_array模块实现打印数组相关的测试程序 C++实现代码 #inclu ...

  9. 快学Scala习题解答—第三章 数组相关操作

    原文链接:http://blog.csdn.net/ivan_pig/article/details/8257365 ----------------------------------------- ...

最新文章

  1. R语言使用rpart包构建决策树模型、使用prune函数进行树的剪枝、交叉验证预防过拟合、plotcp可视化复杂度、rpart.plot包可视化决策树、使用table函数计算混淆矩阵评估分类模型性能
  2. C++——智能指针——auto_ptr、shared_ptr、unique_ptr
  3. 阿里达摩院再造AI抗疫技术:20秒判读CT影像,识别准确率达96%
  4. JMS分布式应用程序异步消息解决方案EhCache 高速缓存同步问题
  5. Windows下安装Object C开发环境,及Hello Word(转)
  6. GIT项目管理工具(part6)--放弃工作区文件修改及从仓库区恢复文件
  7. SAP UI5 StandardListItem和ObjectListItem的区别
  8. renderthread是什么_Android5.0中 hwui 中 RenderThread 工作流程
  9. kettle——入门操作(行扁平化)
  10. Jsp+Ssm+Mysql框架实现的手机WAP版外卖点餐系统
  11. 使用RDKit将pdb文件转成SMILES
  12. 计算机等级考试二级要学PS,关于计算机等级考试题库你所不知道的那些一级PS操作题...
  13. 软考高项(信息系统项目管理师)计算题公式汇总
  14. 【服务器数据恢复】服务器重启后掉线硬盘重新上线同步数据被中断后数据丢失的数据恢复案例
  15. vue element table expand 扩展行点击行展示且保证只展示一行
  16. GitLab安装使用(SSH+Docker两种方式)
  17. top,margin-top,padding-top的区别
  18. InnoDB:page_cleaner:1000ms intended loop 解决
  19. windows下虚拟机ping不通主机的原因+我的解决办法
  20. win10进入系统后一会儿卡死?

热门文章

  1. k8s控制器——Replicaset和Deployment
  2. RCA清洗系统及清洗液自适应预测温度控制
  3. python 修饰符和装饰器_将两个python装饰器组合到on中
  4. Duplicate entry 'sang' for key 'UK_f8t9fsfwc17s6qcbx0ath6l3h'
  5. 揭秘支撑百度搜索、Feed、小程序三大业务的MVVM框架设计思想,San 核心人员倾力打造...
  6. 鞍山树人计算机学校宿舍,南开大学校务公报2016年第12期-信息公开.pdf
  7. 矩阵分解方法总结(未完待续)
  8. 楼宇控制服务器显示FT,【产品介绍】楼宇智控系统
  9. LQ0018 顺子日期【枚举+日期】
  10. android手机慢,揭秘Android手机变慢的三大原因与对策