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 ManipulationString
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void changecase_Click(object sender, EventArgs e)
- {
- if (textBox1.Text == "")
- MessageBox.Show("Pilih jenis Metode");
- else if (comboBox1.SelectedIndex == 0)
- {
- string diupper = textBox1.Text;
- outputnya.Text = diupper.ToUpper();
- }
- else if (comboBox1.SelectedIndex == 1)
- {
- string diupper = textBox1.Text;
- outputnya.Text = diupper.ToLower();
- }
- }
- private void trim_Click(object sender, EventArgs e)
- {
- string hapusspasi;
- hapusspasi = textBox2.Text;
- trimsoutput.Text = hapusspasi.Trim();
- }
- private void indexof_Click(object sender, EventArgs e)
- {
- string stringEmail = textBox3.Text;
- int result = stringEmail.IndexOf(indexofinput.Text);
- if (result == -1)
- {
- MessageBox.Show("Invalid Email Address");
- }
- else
- {
- MessageBox.Show(" found at position"+result.ToString());
- }
- }
- private void fileSystemWatcher1_Changed(object sender, System.IO.FileSystemEventArgs e)
- {
- }
- private void textBox1_TextChanged(object sender, EventArgs e)
- {
- }
- private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
- {
- }
- private void groupBox1_Enter(object sender, EventArgs e)
- {
- }
- private void constrain_Click(object sender, EventArgs e)
- {
- string user, pass;
- user = username.Text;
- pass = password.Text;
- if (user.Equals(pass))
- {
- MessageBox.Show("Jangan sama");
- }
- else
- {
- MessageBox.Show("berhasil");
- }
- }
- private void join_Click(object sender, EventArgs e)
- {
- string inputjoin1, inputjoin2,gabungkan;
- inputjoin1 = join1.Text;
- inputjoin2 = join2.Text;
- gabungkan = inputjoin1 + inputjoin2;
- MessageBox.Show(gabungkan);
- }
- private void outputnya_TextChanged(object sender, EventArgs e)
- {
- }
- private void button1_Click(object sender, EventArgs e)
- {
- if (padin.Text == "")
- MessageBox.Show("masukan inputan");
- else if (comboBox2.SelectedIndex == 0)
- {
- string inputan = padin.Text;
- padout.Text = inputan.PadLeft(10, 'x');
- }
- else if (comboBox2.SelectedIndex == 1)
- {
- string inputan = padin.Text;
- padout.Text = inputan.PadRight(10, 'x');
- }
- }
- private void Replace_Click(object sender, EventArgs e)
- {
- string inputanreplace = inputrep.Text;
- string carireplace = carirep.Text;
- string hasilnyareplace = hasilnyarep.Text;
- MessageBox.Show(inputanreplace.Replace(carireplace,hasilnyareplace));
- }
- private void removee_Click(object sender, EventArgs e)
- {
- string inputanreplace = inputrep.Text;
- string carireplace = carirep.Text;
- MessageBox.Show(inputanreplace.Replace(carireplace, ""));
- }
- private void insertbutton_Click(object sender, EventArgs e)
- {
- string inputaninsertvar = inputaninsert.Text;
- int sisipkankevar = Convert.ToInt16(sisipkanke.Text);
- string yangdisisipkanvar = ygdisisipkan.Text;
- hasilinsert.Text = inputaninsertvar.Insert(sisipkankevar, yangdisisipkanvar);
- }
- private void groupBox8_Enter(object sender, EventArgs e)
- {
- }
- private void join2_TextChanged(object sender, EventArgs e)
- {
- }
- private void sisipkanke_TextChanged(object sender, EventArgs e)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement