Monday, February 17, 2020

Shift array

Shift array:

public static int?[] ShiftArray(int?[] ins)
 {
  if (ins == null || ins.Length == 0) { return ins; }
  var outs = new int?[ins.Length];
  Array.Copy(ins, 1, outs, 0, ins.Length - 1);
  outs[outs.Length - 1] = ins[0];
  return outs;
 }

more at siccolo blurbs

No comments:

Exception handling -> "bubble up

Exception handling -> "bubble up" Exception handling (#1) try { ... // might fail ... } ca...