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.

contains

On Windows, if key is not valid WTF-8, then error.InvalidWtf8 is returned.

See also:

Environ.contains
pub fn contains(environ: Environ, gpa: Allocator, key: []const u8) ContainsError!bool

File

lib/std/process/Environ.zig:564

Code

pub fn contains(environ: Environ, gpa: Allocator, key: []const u8) ContainsError!bool {
    if (native_os == .windows and !unicode.wtf8ValidateSlice(key)) return error.InvalidWtf8;
    var map = try createMap(environ, gpa);
    defer map.deinit();
    return map.contains(key);
}