Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
你能给我 2 种算法如何从 Java 或 C# 中的 2 个字符串数组中制作第三个数组,这些数组的值是唯一的。
C#
string[] c = a.Concat(b).Distinct().ToArray();
假设您正在谈论 PHP(请修复您的标签):
array_unique(array_merge($array1,$array2), SORT_REGULAR);
http://se2.php.net/manual/en/function.array-unique.php