C# 实例 Array 数组

c# 实例

array 数组

@{
string[] members = {"jani", "hege", "kai", "jim"};
int i = array.indexof(members, "kai")+1;
int len = members.length;
string x = members[2-1];
}
<html>
<body>
<h3>members</h3>
@foreach (var person in members)
{
<p>@person</p>
}

<p>the number of names in members are @len</p>
<p>the person at position 2 is @x</p>
<p>kai is now in position @i</p>

</body>
</html>

相关文章