pub fn utf16CountCodepoints(utf16le: []const u16) !usize utf16le: []const u16527
528
529
530
531
532pub fn utf16CountCodepoints(utf16le: []const u16) !usize {
var len: usize = 0;
var it = Utf16LeIterator.init(utf16le);
while (try it.nextCodepoint()) |_| len += 1;
return len;
}
Returns the length of a supplied UTF-16 string literal in terms of unicode codepoints.