Tuesday, March 11, 2014

Use of Array.Foreach() Method

string fileName ="abc#!.txt"; string specialChars = @"\/:*?""<>^|#%&{}~"; Array.ForEach(specialChars.ToCharArray(), specialChar => fileName = fileName.Replace(specialChar, ' '));

No comments: