完成部门管理没实现功能

This commit is contained in:
不做码农
2021-12-25 12:05:30 +08:00
parent 27cca0e4a4
commit 412dccf416
4 changed files with 57 additions and 21 deletions

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
namespace Infrastructure.Extensions
{
@@ -26,5 +27,19 @@ namespace Infrastructure.Extensions
{
return !string.IsNullOrEmpty(str);
}
/// <summary>
/// 注意:如果替换的旧值中有特殊符号,替换将会失败,解决办法 例如特殊符号是“(”: 要在调用本方法前加oldValue=oldValue.Replace("(","//(");
/// </summary>
/// <param name="input"></param>
/// <param name="oldValue"></param>
/// <param name="newValue"></param>
/// <returns></returns>
public static string ReplaceFirst(this string input, string oldValue, string newValue)
{
Regex regEx = new Regex(oldValue, RegexOptions.Multiline);
return regEx.Replace(input, newValue == null ? "" : newValue, 1);
}
}
}