Viewing source for recipe1507cs.aspx
<%@ Page language="c#" %>
<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
string input = " ASPAlliance.com ";
OutputTextBox.Text = "[" + input + "]\n";
// Trim Left
OutputTextBox.Text += "[" + input.TrimStart() + "]\n";
// Trim Right
OutputTextBox.Text += "[" + input.TrimEnd() + "]\n";
// Trim All
OutputTextBox.Text += "[" + input.Trim() + "]\n";
// Pad Left
OutputTextBox.Text += "[" + input.PadLeft(30) + "]\n";
// Pad Right
OutputTextBox.Text += "[" + input.PadRight(30) + "]\n";
}
</script>
<html>
<body>
<form id="Test" method="post" runat="server">
<asp:TextBox id="OutputTextBox" runat="server" TextMode="MultiLine" Height="157px" Width="306px"></asp:TextBox>
</form>
</body>
</html>