添加项目文件。

This commit is contained in:
liming 蔡
2026-07-14 13:55:17 +08:00
parent 63759495f2
commit 8bbdf78731
335 changed files with 81415 additions and 0 deletions
+65
View File
@@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JY.Inspection.Common
{
public class StrUtil
{
/// <summary>
/// 前端字节补0
/// </summary>
/// <param name="str"></param>
/// <param name="count"></param>
/// <returns></returns>
public static string GetStartString(string str, int count)
{
string strRes = str;
int strCount = str.Length;
if (strCount != count)
{
strRes = str.PadLeft(count, '0');
}
return strRes;
}
/// <summary>
/// 增加结尾字节长度
/// </summary>
/// <param name="str"></param>
/// <param name="count"></param>
/// <returns></returns>
public static string GetEndString(string str, int count)
{
string strRes = str;
int strCount = str.Length;
if (strCount != count)
{
strRes = str.PadRight(count, ' ');
}
return strRes;
}
/// <summary>
/// 生成字符串List集合
/// </summary>
/// <param name="Num"></param>
/// <returns></returns>
public static List<string> GetListString(int Num, string str)
{
List<string> list = new List<string>();
for (int i = 0; i < Num; i++)
{
list.Add(str);
}
return list;
}
}
}