Tag: concat

JSON.NET \如何在JSon.net中连接两个JSON

我有两个JSON(作为简单的字符串) – 是否有简洁的方法来连接它们? 作为基础设施的一部分??

加入2个包含许多列的DataTables

我有一个问题,想要加入2个同一列的表。 表1包含Name,LastName Columns和许多其他列,表2包含Name,Comment和许多其他列。 我想用Name列加入它们,结果应该是Name,LastName,Comment和其他列。 我尝试使用左外侧Linq,但不知道如何编写select new,因为我不知道我有多少其他列。 我的表1: Name1 LastName … Niki Row … Hube Slang … Koke Mi … … … … … … … 表2: Name Comment … Koke “Hello” … Niki “Hi” … 结果应该是: Name LastName Comment … Niki Row “Hi” … Hube Sland … Koke Mi “Hello”… … … … 所以我试着将这些行连在一起。 但是它说table1中的数组比表2中的数组长。有没有其他方法可以加入它? […]

如何在C#中将变量连接到正则表达式

我试图将变量连接到c#中的regen,但它无法正常工作 string color_id = “sdsdssd”; Match variations = Regex.Match (data, @””+color_id+”_[^\””]*\””\W\,\””sizes\””\:\s*\W.*?businessCatalogItemId””:\””)”, RegexOptions.IgnoreCase);@””+color_id+”_[^\””]*\””\W\,\””sizes\””\:\s*\W.*?businessCatalogItemId””:\””)”; 但以上情况并不奏效 如何在c#中将起始元素的变量连接到regex

在扩展方法中更改数组的大小不起作用?

所以基本上我为数组类型编写了一个小的Add扩展方法。 using System; using System.Linq; public static class Extensions { public static void Add(this T[] _self, T item) { _self = _self.Concat(new T[] { item }).ToArray(); } } public class Program { public static void Main() { string[] test = { “Hello” }; test = test.Concat(new string[] { “cruel” }).ToArray(); test.Add(“but funny”); Console.WriteLine(String.Join(” “, test) […]

哪个更快:Union或Concat?

我不关心元素的顺序。 http://msdn.microsoft.com/en-us/library/system.linq.enumerable.union.aspx http://msdn.microsoft.com/en-us/library/bb302894.aspx

C#:连接2个MP3文件

我尝试使用下面的代码连接2个MP3文件。 我有一个新文件,我可以播放上半部分(完成第一个文件),但下半部分是静音。 新文件的长度是正确的。 我做错了什么? List files = new List(); var tempfile = File.ReadAllBytes(Path.Combine(path, “1.mp3”)); files.Add(tempfile); tempfile = File.ReadAllBytes(Path.Combine(path, “2.mp3”)); files.Add(tempfile); Byte[] a=new Byte[files[0].Length+files[1].Length]; Array.Copy(files[0], a, files[0].Length); Array.Copy(files[1], a, files[1].Length); File.WriteAllBytes(Path.Combine(path, “3.mp3”) , a);