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:
Post a Comment