I cant figure out what I'm doing wrong. My replace statements are not working. The string "name" is never changed.
An example file.Name would be Dave Matthews Band - Crash Into Me (Live) (Live In Stl) (Warehouse 5).mp3
I copied that straight out of the debugger. Any ideas?
Code:
if (folderBrowser.ShowDialog() == DialogResult.OK) {
String path = folderBrowser.SelectedPath;
DirectoryInfo direc = new DirectoryInfo(path);
FileInfo[] files = direc.GetFiles();
for (int i = 0; i < files.Length; i++) {
FileInfo file = files[i];
String name = file.Name;
// remove the crap
name.Replace("(Live)", "");
name.Replace("(Live In Stl)", "");
name.Replace("(Warehouse 5)", "");
file.MoveTo(file.DirectoryName + "\\" + name);
}
MessageBox.Show("Done!");
}
An example file.Name would be Dave Matthews Band - Crash Into Me (Live) (Live In Stl) (Warehouse 5).mp3
I copied that straight out of the debugger. Any ideas?