Gets the "i"th character of the Cord and returns it, provided that 0 <= i < Cord.size().

Synopsis

Declared in <absl/strings/cord.h>

char
operator[](size_t i) const;

Description

NOTE: This routine is reasonably efficient. It is roughly logarithmic based on the number of chunks that make up the cord. Still, if you need to iterate over the contents of a cord, you should use a CharIterator/ChunkIterator rather than call operator[] repeatedly in a loop.

Return Value

The character at index i.

Parameters

Name

Description

i

The index of the character to retrieve.

Created with MrDocs