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

testUtf8PeekCodepoint

Private Function
std.unicode.testUtf8PeekCodepoint
fn testUtf8PeekCodepoint() !void

File

unicode.zig:805
805
806
807
808
809
810
811
812
813
814
815
816
817
fn testUtf8PeekCodepoint() !void {
    const s = Utf8View.initComptime("東京市");
    var it = s.iterator();

    try testing.expect(it.peekCodepoint().? == 0x6771);
    try testing.expect(it.peekCodepoint().? == 0x6771);
    _ = it.nextCodepoint();
    try testing.expect(it.peekCodepoint().? == 0x4eac);
    _ = it.nextCodepoint();
    try testing.expect(it.peekCodepoint().? == 0x5e02);
    _ = it.nextCodepoint();
    try testing.expect(it.peekCodepoint() == null);
}