目前,它只适用于长度小于 200 个字符的字符串,并且所有字符都在一行上。...,元素序列就是一组由中括号括起来的元素,匹配使用 is 关键字。...值为 false, 长度没有匹配
result = testArray is [1, 2, 3, 5];
// result 值为 true, 元素、长度、位置都匹配
result = testArray...testArray ,想要知道是否匹配第一个元素为 1 ,可以这样来实现:
int[] testArray = { 1, 2, 3, 5, 8 };
bool result = false;
//...result 值为 true,序列的长度和数组匹配,第一个元素也是 1
result = testArray is [1, _, _, _, _];
序列的长度要和数字相同;
序列中不用匹配的元素可以使用