Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
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 standard library. Private Function

isValidScheme

Private Function
std.Uri.isValidScheme
fn isValidScheme(scheme: []const u8) bool

scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )

Params

  • scheme: []const u8

File

Uri.zig:487
487
488
489
490
491
492
493
494
495
496
497
fn isValidScheme(scheme: []const u8) bool {
    if (scheme.len == 0) return false;
    if (!std.ascii.isAlphabetic(scheme[0])) return false;
    for (scheme[1..]) |byte| {
        switch (byte) {
            'A'...'Z', 'a'...'z', '0'...'9', '+', '-', '.' => continue,
            else => return false,
        }
    }
    return true;
}