Returns subtraction between given String arrays.

@param arr1 first array
@param arr2 second array
@return arr1 without values which are not present in arr2
496902
public static String[] subtraction(String[] arr1, String[] arr2) {
        if (arr1 == null || arr1.length == 0 || arr2 == null || arr2.length == 0) {
            return arr1;
        }
        List<String> list = new ArrayList<String>(Arrays.asList(arr1));
        list.removeAll(Arrays.asList(arr2));
        return list.toArray(new String[0]);
    }
116631
public double subtract(int[] indices, double val) {
        checkIndices(indices);
        int c = getConfigIdx(indices);
        return values.set(c, s.minus(values.get(c), val));
    }
1337344
def array_diff(array1, array2, format = :text)
    string1 = array1.join("\n") + "\n"
    string2 = array2.join("\n") + "\n"
    Diffy::Diff.new(string1, string2).to_s(format)
  end
661990
private static BigDecimal doSubtract(final BigDecimal v1, final BigDecimal v2) {
        BigDecimal diff = v1;
        if (v1 != null && v2 != null) {
            diff = v1.subtract(v2);
        } else if (v2 != null) {
            diff = v2.negate();
        }
        return diff;
    }
397346
public static int compare(Long[] arrayA, Long[] arrayB)
    {
        int len1 = arrayA.length;
        int len2 = arrayB.length;
        int lim = Math.min(len1, len2);

        int k = 0;
        while (k < lim)
        {
            Long c1 = arrayA[k];
            Long c2 = arrayB[k];
            if (!c1.equals(c2))
            {
                return c1.compareTo(c2);
            }
            ++k;
        }
        return len1 - len2;
    }
506480
public static function subtract(array ...$arrays): array
    {
        self::checkArrayLengths($arrays);

        $number_of_arrays = count($arrays);
        $length_of_arrays = count($arrays[0]);
        $differences      = array_map(
            function ($x) {
                return $x;
            },
            $arrays[0]
        );

        for ($i = 0; $i < $length_of_arrays; $i++) {
            for ($j = 1; $j < $number_of_arrays; $j++) {
                $differences[$i] -= $arrays[$j][$i];
            }
        }

        return $differences;
    }
874894
private static function setDiff(array $arr1, array $arr2)
    {
        $missingSets = array();
        
        foreach ($arr1 as $searchSet)
        {
            $found = false;
            
            foreach ($arr2 as $subArray2)
            {
                if ($subArray2 === $searchSet)
                {
                    $found = true;
                    break;
                }
            }
            
            if (!$found)
            {
                $missingSets[] = $searchSet;
            }
        }
        
        return $missingSets;
    }
1116954
function arrayIntersection(arr1, arr2) {
  if (_.isEqual(arr1, arr2)) {
    return arr1;
  }

  return arr1.filter(v => arrayIncludes(arr2, v));
}
127831
public static void subtract(double val , DMatrixD1 a , DMatrixD1 c ) {
        c.reshape(a.numRows,a.numCols);

        final int length = a.getNumElements();

        for( int i = 0; i < length; i++ ) {
            c.data[i] = val - a.data[i];
        }
    }
1195937
function combine(arr1, arr2) {
        if (arr2 == null) {
            return arr1;
        }

        var i = -1, len = arr2.length;
        while (++i < len) {
            if (indexOf(arr1, arr2[i]) === -1) {
                arr1.push(arr2[i]);
            }
        }

        return arr1;
    }
1342881
function ( array1, array2 ) {
		var result = [];

		array.each( array1, function ( i ) {
			if ( !array.contains( array2, i ) ) {
				array.add( result, i );
			}
		});

		array.each( array2, function ( i ) {
			if ( !array.contains( array1, i ) ) {
				array.add( result, i );
			}
		});

		return result;
	}
1303497
public static String subtractSeq(final String first, final String second) {
    return subtractSeq(first, second, DELIMITER);
  }
342394
public double distance(int[] point1, int[] point2) throws Exception {
    return Math.sqrt(Long.valueOf(distance2(point1, point2)).doubleValue());
  }
1338170
public double subtract(int[] indices, double val) {
        checkIndices(indices);
        int c = getConfigIdx(indices);
        double prev = values[c];
        values[c] = s.minus(values[c], val);
        return prev;
    }
998589
public static void subtractEquals( DMatrix2x2 a , DMatrix2x2 b ) {
        a.a11 -= b.a11;
        a.a12 -= b.a12;
        a.a21 -= b.a21;
        a.a22 -= b.a22;
    }
1014441
public static void subtractEquals( DMatrix3 a , DMatrix3 b ) {
        a.a1 -= b.a1;
        a.a2 -= b.a2;
        a.a3 -= b.a3;
    }
634450
public static String subtractSeq(String first, String second, String delimiter) {
    if (isEmpty(first)) { return ""; }
    if (isEmpty(second)) {
      StringBuilder builder = new StringBuilder();
      if (!first.startsWith(delimiter)) builder.append(delimiter).append(first);
      if (!first.endsWith(delimiter)) builder.append(first).append(delimiter);
      return builder.toString();
    }
    List<String> firstSeq = Arrays.asList(split(first, delimiter));
    List<String> secondSeq = Arrays.asList(split(second, delimiter));
    Collection<String> rs = CollectUtils.subtract(firstSeq, secondSeq);
    StringBuilder buf = new StringBuilder();
    for (final String ele : rs)
      buf.append(delimiter).append(ele);
    if (buf.length() > 0) buf.append(delimiter);
    return buf.toString();
  }