|
|
|
รบกวนถามเรื่องการแยกชุดข้อมูล ตัด string (C#) , .NET ,Split , C# |
|
|
|
|
|
|
|
Code (C#) Split String
<%@ Page Language="C#" %>
<script runat="server">
void Page_Load(Object sender, EventArgs e)
{
String strString = "2006,2007,2008,2009";
String[] myArr = strString.Split(',');
int i =0;
foreach (String myList in myArr)
{
this.lblText1.Text = this.lblText1.Text + "(" + i + ") " + myList + "<br>";
i = i + 1;
}
}
</script>
<html>
<head>
</head>
<body>
<form runat="server">
<asp:Label id="lblText1" runat="server"></asp:Label>
</form>
</body>
</html>
|
|
|
|
|
Date :
2009-10-03 22:12:42 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|