|
@@ -1,6 +1,7 @@
|
|
|
using System;
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
|
using System.Text;
|
|
using System.Text;
|
|
|
|
|
+using System.Web;
|
|
|
using System.Text.RegularExpressions;
|
|
using System.Text.RegularExpressions;
|
|
|
|
|
|
|
|
namespace Common
|
|
namespace Common
|
|
@@ -16,6 +17,7 @@ namespace Common
|
|
|
public static long[] SpitLongArrary(string str, char split = ',')
|
|
public static long[] SpitLongArrary(string str, char split = ',')
|
|
|
{
|
|
{
|
|
|
if (string.IsNullOrEmpty(str)) { return Array.Empty<long>(); }
|
|
if (string.IsNullOrEmpty(str)) { return Array.Empty<long>(); }
|
|
|
|
|
+ str = HttpUtility.UrlDecode(str);
|
|
|
str = str.TrimStart(split).TrimEnd(split);
|
|
str = str.TrimStart(split).TrimEnd(split);
|
|
|
string[] strIds = str.Split(split, (char)StringSplitOptions.RemoveEmptyEntries);
|
|
string[] strIds = str.Split(split, (char)StringSplitOptions.RemoveEmptyEntries);
|
|
|
long[] infoIdss = Array.ConvertAll(strIds, s => long.Parse(s));
|
|
long[] infoIdss = Array.ConvertAll(strIds, s => long.Parse(s));
|
|
@@ -25,6 +27,7 @@ namespace Common
|
|
|
public static int[] SpitIntArrary(string str, char split = ',')
|
|
public static int[] SpitIntArrary(string str, char split = ',')
|
|
|
{
|
|
{
|
|
|
if (string.IsNullOrEmpty(str)) { return Array.Empty<int>(); }
|
|
if (string.IsNullOrEmpty(str)) { return Array.Empty<int>(); }
|
|
|
|
|
+ str = HttpUtility.UrlDecode(str);
|
|
|
string[] strIds = str.Split(split, (char)StringSplitOptions.RemoveEmptyEntries);
|
|
string[] strIds = str.Split(split, (char)StringSplitOptions.RemoveEmptyEntries);
|
|
|
int[] infoIdss = Array.ConvertAll(strIds, s => int.Parse(s));
|
|
int[] infoIdss = Array.ConvertAll(strIds, s => int.Parse(s));
|
|
|
return infoIdss;
|
|
return infoIdss;
|
|
@@ -32,6 +35,7 @@ namespace Common
|
|
|
public static T[] SplitAndConvert<T>(string input, char split = ',')
|
|
public static T[] SplitAndConvert<T>(string input, char split = ',')
|
|
|
{
|
|
{
|
|
|
if (string.IsNullOrEmpty(input)) { return Array.Empty<T>(); }
|
|
if (string.IsNullOrEmpty(input)) { return Array.Empty<T>(); }
|
|
|
|
|
+ input = HttpUtility.UrlDecode(input);
|
|
|
string[] parts = input.Split(split, (char)StringSplitOptions.RemoveEmptyEntries);
|
|
string[] parts = input.Split(split, (char)StringSplitOptions.RemoveEmptyEntries);
|
|
|
T[] result = Array.ConvertAll(parts, s => (T)Convert.ChangeType(s, typeof(T)));
|
|
T[] result = Array.ConvertAll(parts, s => (T)Convert.ChangeType(s, typeof(T)));
|
|
|
//for (int i = 0; i < parts.Length; i++)
|
|
//for (int i = 0; i < parts.Length; i++)
|