fix 字符串为空分割bug
This commit is contained in:
parent
96b2f8524a
commit
2cf5f5c87d
@ -13,6 +13,7 @@ namespace ZR.Common
|
||||
/// <returns></returns>
|
||||
public static long[] SpitLongArrary(string str)
|
||||
{
|
||||
if (string.IsNullOrEmpty(str)) { return Array.Empty<long>(); }
|
||||
string[] strIds = str.Split(',', (char)StringSplitOptions.RemoveEmptyEntries);
|
||||
long[] infoIdss = Array.ConvertAll(strIds, s => long.Parse(s));
|
||||
return infoIdss;
|
||||
@ -20,6 +21,7 @@ namespace ZR.Common
|
||||
|
||||
public static int[] SpitIntArrary(string str)
|
||||
{
|
||||
if (string.IsNullOrEmpty(str)) { return Array.Empty<int>(); }
|
||||
string[] strIds = str.Split(',', (char)StringSplitOptions.RemoveEmptyEntries);
|
||||
int[] infoIdss = Array.ConvertAll(strIds, s => int.Parse(s));
|
||||
return infoIdss;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user