Witam,
Probuję napisać program który pobierze tekst z pliku, a następnie zamięni wszystkie wystąpienia danej litery w tekscie.
Niestety nie wiem, jak podmienić konkretną literę .
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void openBtn_Click(object sender, EventArgs e)
{
openFileDialog1.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
openFileDialog1.FileName = "Napisy";
openFileDialog1.Filter = "Pliki tekstowe(*.txt)|*.txt";
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
string fileName = openFileDialog1.FileName;
textBox2.Text= File.ReadAllText(fileName);
}
}
private void saveBtn_Click(object sender, EventArgs e)
{
}
private void changeBtn_Click(object sender, EventArgs e)
{
if (!String.IsNullOrEmpty(textBox2.Text))
{
string change = textBox2.Text;
if ()
{
}
}
else
{
MessageBox.Show("Nie wczytałes tekstu do zmiany!", "Błąd");
}
}
private void openFileDialog1_FileOk(object sender, CancelEventArgs e)
{
}
}
}