I have an array with items having names with .txt. I want to remove the extension. The following code is not working.
var xx = filenames.ForEach(x =>
{
int fileExtPos = x.LastIndexOf(".");
if (fileExtPos >= 0)
x = x.Substring(0, fileExtPos);
});
Can anyone help what am i doing wrong here?
Thanks