Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace CheckBox
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void Conversion_Click(object sender, EventArgs e)
- {
- if ((!checkBox1.Checked) && (!checkBox2.Checked) && (!checkBox3.Checked))
- {
- textBox2.Text = textBox1.Text;
- }
- else
- {
- foreach (char ch in textBox1.Text)
- {
- string temp = ch.ToString();
- if (checkBox1.Checked)
- {
- if (char.IsDigit(ch))
- temp = "";
- }
- if (checkBox2.Checked)
- {
- if (char.IsLower(ch))
- temp = (char.ToUpper(ch).ToString());
- else if(char.IsUpper(ch))
- temp = (char.ToLower(ch).ToString());
- }
- if (checkBox3.Checked)
- {
- if (char.IsWhiteSpace(ch))
- temp = "";
- }
- textBox2.Text += temp;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement