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. 技术正文 history命令添加时间---测试磁盘写入速度
  2. 第十一篇: Ajax Control Toolkit 控件包--下载与安装
  3. Linux 802.11 Driver Developer’s Guide
  4. 当我不再依赖你的时候说说_不要依赖任何人说说 不要指望别人的经典话
  5. python人工智能是什么意思_人工智能和python有什么关系?
  6. 查看类的实现类mac_自定义类加载器实现热加载
  7. [leetcode]5341. 最后 K 个数的乘积
  8. BZOJ P1059 [ZJOI2007]矩阵游戏——solution
  9. linux socket 104 错误,linux socket连接中 ERRNO错误
  10. ios备忘录下载安卓版_ios8备忘录app软件下载
  11. WinDriver 安装
  12. linux ps auxf,ps -aux命令详解
  13. js实现代码高亮显示
  14. 物联网嵌入式学习路线
  15. 智能访客机要注意这些陷阱
  16. jQuery中的end()定义和用法
  17. 【SecureCRT】SecureCRT 绝佳配色方案, 保护你的眼睛
  18. 511遇见易语言学习易语言常量
  19. 电脑文件误删除如何恢复?可以快速找回
  20. 职中计算机一级证,职中计算机等级一级考证教学网站的设计

热门文章

  1. python里π怎么打_python里的π怎么输入
  2. 艾兰岛编辑器-无法通过的屏障
  3. 《炬丰科技-半导体工艺》半导体单晶片旋转清洗器中涡流的周期性结构
  4. 自然语言处理(NLP)任务中常用的分词工具及底层算法支持
  5. deepfakes怎么用_手把手教你使用 Deepfakes 换脸
  6. 小米互联通信服务_小米战华为,中国手机市场正上演最精彩攻防战
  7. cmd操作MySQL 多表查询(日记 day 4)
  8. Flutter自定义IOS的Plugin
  9. 【Node.js】node入门全攻略
  10. 环信php创建群组,群组@功能