岗位培训
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 字符串操作辅助类
|
||||
/// </summary>
|
||||
public class StringHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// 字符串转换
|
||||
/// 'A,B,C' => 'A','B','C'
|
||||
/// </summary>
|
||||
/// <param name="str"></param>
|
||||
/// <returns></returns>
|
||||
public static string StringConvert(string str)
|
||||
{
|
||||
string result = string.Empty;
|
||||
if (!string.IsNullOrWhiteSpace(str))
|
||||
{
|
||||
string[] items = str.Split(',');
|
||||
result = string.Join(",", items.Select(x => $"'{x}'"));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user