日期:2014-05-17 浏览次数:20520 次
public String ReturnStr(IList<Model> list)
{
StringBuilder sb = new StringBuilder();
sb.Append("[");
foreach (var model in list)
{
sb.Append(model.Name);
}
return sb + "]";
}
[__DynamicallyInvokable]
public static string Concat(params object[] args)
{
if (args == null)
{
throw new ArgumentNullException("args");
}
string[] values = new string[args.Length];
int totalLength = 0;
for (int i = 0; i < args.Length; i++)
{
object obj2 = args[i];
values[i] = (obj2 == null) ? Empty : obj2.ToString();
if (values[i] == null)
{
values[i] = Empty;
}
totalLength += values[i].Length;
if (totalLength < 0)
{
throw new OutOfMemoryException();
}
}
return ConcatArray(values, totalLength);
}