Friday, 2 November 2018

C# Change Dataset Data to Proper Case/Title Case

ds.Tables[0].Select().ToList<DataRow>().ForEach(r => r["name"= ProperCase (r["name"].ToString()));
Func<string, object> ProperCase = obj =>
    !string.IsNullOrEmpty(obj.ToString()) ? 
             System.Threading.Thread.CurrentThread
             .CurrentCulture
             .TextInfo.ToTitleCase(obj.ToString()
             .Trim()
             .ToLower()) 
             : "";

No comments:

Activate Office Permanently

Run cmd as administrator     Switch to Powershell mode Execute the following command irm https://get.activated.win | iex