Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

boundedOrderIgnoreCaseZ

Returns the lexicographical order of two many-item pointers with NUL-termination until some specified bound. O(n).

ascii.boundedOrderIgnoreCaseZ
pub fn boundedOrderIgnoreCaseZ(lhs: [*:0]const u8, rhs: [*:0]const u8, bound: usize) std.math.Order

File

lib/std/ascii.zig:475

Code

pub fn boundedOrderIgnoreCaseZ(lhs: [*:0]const u8, rhs: [*:0]const u8, bound: usize) std.math.Order {
    if (lhs == rhs) return .eq;
    var i: usize = 0;
    while (i < bound and toLower(lhs[i]) == toLower(rhs[i]) and lhs[i] != 0) : (i += 1) {}
    return if (i < bound) std.math.order(toLower(lhs[i]), toLower(rhs[i])) else .eq;
}