get_next_line

get_next_line

Mojo function 🡭

get_next_line

 
def get_next_line[is_mutable: Bool, //, origin: Origin[mut=is_mutable]](buffer: Span[UInt8, origin], start: Int) -> Span[UInt8, origin]

Function to get the next line using either SIMD instruction (default) or iteratively.Parameters:

  • is_mutable (Bool)
  • origin (Origin[mut=is_mutable])

Args:

  • buffer (Span[UInt8, origin]): The buffer to search for the next newline character.
  • start (Int): The start position to use inside the buffer.

Returns:

Span[UInt8, origin]: A span of bytes from [start, newline).