Loop over multiple arrays simultaneously: Difference between revisions

m (→‎{{header|Tailspin}}: syntax update)
(→‎{{header|C sharp|C#}}: Edited a little)
Line 529:
 
 
Using Enumerable.Zip (stops when either source runs out of elements):
Using Zip:
 
<lang csharp>
Line 539:
</lang>
 
 
Like how a perl programmer would write it (still using Zip):
 
<lang csharp>
Line 546 ⟶ 547:
</lang>
 
 
Using inputs arrays of differents length:
Custom implementation for arrays of different lengths that pads with spaces after the end of the shorter arrays:
<lang csharp>
public static void Multiloop(char[] A, char[] B, int[] C)
Anonymous user