MachineCode via Digitalmars-d-learn
2014-10-16 04:35:12 UTC
Is there one function in the Phobos library to check if give an
array is equal to first elements in another array? e.g, f(a, b)
the entire b array must match to first elements in a and then
there was) in the D's library so what's a good name (that'a
descriptive) to such a function?
a.length >= bx.length checks otherwise I can have a range
violation error
array is equal to first elements in another array? e.g, f(a, b)
the entire b array must match to first elements in a and then
a[0 .. b.length] == b
probably there's no such a function (but I wouldn't find bad ifthere was) in the D's library so what's a good name (that'a
descriptive) to such a function?
if(a.length >= b1.length && a[0 .. b1.length] == b1) { ... }
if(a.length >= b2.length && a[0 .. b2.length] == b2) { ... }
since if bx.length < a.length is valid I can't remove all theif(a.length >= b2.length && a[0 .. b2.length] == b2) { ... }
a.length >= bx.length checks otherwise I can have a range
violation error