ASP.NET Tutorial/Language Basics/for each

Материал из .Net Framework эксперт
Перейти к: навигация, поиск

Use for each to loop through array (VB)

<%@ Page Language="VB" %>
<script runat="server">
   sub Page_Load(Sender as object, e as eventargs)
      dim strDay as string
      dim arrWeekDays() as String = {"Monday", "Tuesday", _
        "Wednesday", "Thursday", "Friday"}
      For Each strDay in arrWeekDays
         Response.Write(strDay & "<br>")
         exit for
      Next
   
   end sub   
</script>
<html><body>
</body></html>