如何从.NET中的字符串中删除变音符号(重音符号),“ /”和大写字母?

时间:2019-05-30 13:22:46

标签: asp.net-mvc linq-to-excel

我该如何创建一种方法来执行3项操作,例如检查大写字母并放小写字母,将“ /”替换为“”并删除重音符号?
这是我的代码。将模型与BD进行比较

var useriditem = _context.TBL_UserFunctionScope.Where(m => m.Name == model.Scope2UserFunctionScope).FirstOrDefault().FunctionScopeID;
                                            TBL_ExtraJobs item = new TBL_ExtraJobs();

                                            if (colNames.IndexOf(item2) == 0)
                                            {
                                                if (model.Hours == null)
                                                {
                                                    item.Hours = 0;
                                                }
                                                else
                                                {
                                                    item.Hours = (decimal)model.Hours;

                                                }
                                            }
                                            if (colNames.IndexOf(item2) == 1)
                                            {
                                                if (model.Hours1 == null)
                                                {
                                                    item.Hours = 0;
                                                }
                                                else
                                                {
                                                    item.Hours = (decimal)model.Hours1;
                                                }
                                            }
                                            //model.Scope1UserFunction = _context.TBL_UserFunction.Where(m => m.FunctionID == model.FunctionScopeID).FirstOrDefault().Name;
                                            //model.Scope2UserFunctionScope = _context.TBL_UserFunctionScope.Where(m => m.FunctionID == model.FunctionScopeID).FirstOrDefault().Name;
                                            item.FunctionScopeID = useriditem;
                                            item.UserID = _context.TBL_User.Where(m => m.Username.Equals(item2)).Select(o => o.UserID).FirstOrDefault();
                                            item.Day = DateTime.UtcNow;
                                            item.Description = "Inserir Comentario";
                                            item.CreateDate = DateTime.UtcNow;
                                            item.CreateBy = userID;
                                            _context.TBL_ExtraJobs.Add(item);
                                            _context.SaveChanges();

0 个答案:

没有答案