Smart猫小萌
private static string custom_AppendString(string value, string append)
{ if (!string.IsNullOrEmpty(value))
{ if (append.IndexOf(",") > -1)
{ string[] typesB = append.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); foreach (string item in typesB)
{
value = value.IndexOf(item) > -1 ? value : value += "," + item;
}
} else
{
value = value.IndexOf(append) > -1 ? value : value += "," + append;
}
} else
{
value = append;
} return value;
}
//A: 1, 2 ,3 B: 2, 4, 6
//custom_AppendString(A,B);
//result 1,2,3,4,6
//自己改吧 , 差不多的意思