ASP.NET Trim() ตัดช่องว่างด้านซ้ายและขวาของข้อความ
Syntax
Trim(String)
String.Trim()
Sample
<%@ Page Language="VB" %>
<script runat="server">
Sub Page_Load(sender As Object, e As EventArgs)
Dim strString As String = "I Love ThaiCreate.Com Version 2009 "
Me.lblText1.Text = Trim(strString)
Me.lblText2.Text = strString.Trim()
End Sub
</script>
<html>
<head>
</head>
<body>
<form runat="server">
<asp:Label id="lblText1" runat="server"></asp:Label>
<br />
<asp:Label id="lblText2" runat="server"></asp:Label>
</form>
</body>
</html>