int strncmp(string a, string b, int n) {
if(a.length > n)
a = a[0 .. n];
if(b.length > n)
b = b[0 .. n];
import std.algorithm.comparison : cmp;
return cmp(a, b);
}
Re: Is there a d analog of strncmp?
Adam D. Ruppe via Digitalmars-d-learn Sun, 21 Aug 2016 17:16:01 -0700
- Is there a d analog of strncmp? dan via Digitalmars-d-learn
- Re: Is there a d analog of s... Adam D. Ruppe via Digitalmars-d-learn
- Re: Is there a d analog ... Jonathan M Davis via Digitalmars-d-learn
- Re: Is there a d analog ... dan via Digitalmars-d-learn
- Re: Is there a d analog of s... cy via Digitalmars-d-learn
