菜鸟学堂
在线运行
源代码
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" href="/try/showrazor.css" /> </head> <body> <span class="marked">@{<br>string[] members = {"Jani", "Hege", "Kai", "Jim"};<br> int i = Array.IndexOf(members, "Kai")+1;<br>int len = members.Length;<br>string x = members[2-1];<br>}<br></span><html><br><body><br><h3>Members</h3><br> <span class="marked">@foreach (var person in members)<br>{<br><p>@person</p><br>}</span><br><p>The number of names in Members are <span class="marked">@len</span></p><br> <p>The person at position 2 is <span class="marked">@x</span></p><br><p>Kai is now in position <span class="marked">@i</span></p><br><br></body><br></html><br> </body> </html>
运行结果
在线运行
菜鸟学堂 edu.jb51.net