Practical 1.: Design
Practical 1.: Design
Practical 1.: Design
NET
b) Create an application to demonstrate string operations.
Design:-
String.aspx
Code:-
String.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
}
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
string str1;
str1 = TextBox1.Text;
string[] words = str1.Split();
for (int i = 0; i < words.Length; i++)
{
TextBox2.Text = TextBox2.Text + words[i] + "\r\n";
}
}
protected void Button2_Click(object sender, EventArgs e)
{
string str1, str2;
str1 = TextBox1.Text;
str2 = str1.ToUpper();
TextBox2.Text = str2;
}
protected void Button3_Click(object sender, EventArgs e)
{
string str1, str2;
str1 = TextBox1.Text;
str2 = str1.ToLower();
TextBox2.Text = str2;
}
}
Output:-