How to convert (change) a string to lowercase characters in asp.net
ToLower.aspx
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void page_Load(object sender, System.EventArgs e) {
if(!this.IsPostBack)
{
TextBox1.Text = "CLICk BUTTON FOR Convert string to Lowercase.";
TextBox1.Width = 350;
}
}
protected void Button1_Click(object sender, System.EventArgs e) {
string myString = TextBox1.Text.ToString();
string modifiedString = myString.ToLower();
Label1.Text = "String converted successfully to lower case!";
TextBox1.Text = modifiedString;
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>How to convert (change) a string to lowercase characters in asp.net</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h2 style="color:Red">asp.net string example: ToLower()</h2>
<asp:Label
ID="Label1"
runat="server"
Font-Size="Large"
ForeColor="HotPink"
Font-Bold="true"
Font-Italic="true"
>
</asp:Label>
<br /><br />
<asp:Label
ID="Label2"
runat="server"
Text="Test String"
ForeColor="Green"
>
</asp:Label>
<asp:TextBox
ID="TextBox1"
runat="server"
BackColor="DarkGreen"
ForeColor="SpringGreen"
>
</asp:TextBox>
<br /><br />
<asp:Button
ID="Button1"
runat="server"
OnClick="Button1_Click"
Font-Bold="true"
Text="Change String To Lowercase"
ForeColor="Green"
/>
</div>
</form>
</body>
</html>
- How to convert (change) a string to uppercase characters in asp.net
- How to replace a specified substring with another string in asp.net
- How to insert a string inside a string at a specified index position in asp.net
- How to split a string with specific delimiter and populate an array in asp.net
- How to find the first index position of a substring in a string
- How to find the last index position of a substring in a string
- How to remove a specified number of strings from a specified position in a string
- How to join an array of strings (elements) into a new string with specific separator
- How to compare two string in asp.net (case sensitive)
- How to compare two string in asp.net (case insensitive/ ignore case)