Anonymous user
Loop over multiple arrays simultaneously: Difference between revisions
Loop over multiple arrays simultaneously (view source)
Revision as of 08:46, 25 August 2019
, 4 years ago→{{header|C sharp|C#}}: Edited a little
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):
<lang csharp>
Line 539:
</lang>
Like how a perl programmer would write it (still using Zip):
<lang csharp>
Line 546 ⟶ 547:
</lang>
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)
|