Want to develop such application to replace certain string and give its output.

kmr1154

Distinguished
Feb 28, 2012
17
0
18,560
Hello

I am working on some school project and to make my work fast i need such application which can do simple replacing of sting value. Suppose its like this..
For example:-
The original texts is "Hello my employee id is xxx010101", i want to replace employee id "xxx010101" with the one i specify in the program like "ggg030303". And after replacing i want program to show its output with complete sentence in another text box like "Hello my employee id is ggg030303".

So program structure should be like this

A 640x480 resolution GUI window

3 text boxes.

First one for the string value needs to be replaced.

Second one is for the value like "ggg030303" which will be used for replace.

Third one will be for output. And one submit button.

Anyone can figure out its code?



Thank you
 

kmr1154

Distinguished
Feb 28, 2012
17
0
18,560
Well, i asked my programming teacher and i got my solution...
Developed using C#

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 WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
textBox3.Text = textBox1.Text.Substring(0,5) + "" + textBox2.Text;
}

private void Form1_Load(object sender, EventArgs e)
{

}

private void textBox1_TextChanged(object sender, EventArgs e)
{

}
}
}

This is just an example, i have modified it according to my needs and got my results.