Somehow I can\'t seem to get string replacement within a foreach loop in C# to work. My code is as follows :
foreach (string s in names) { s.Replace(\"pdf\"
Why use replace, this will make the application slow. Use regex:
http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex.replace.aspx