locate_first_different_char

Defined in header: <orcus/stream.hpp>

std::size_t orcus::locate_first_different_char(std::string_view left, std::string_view right)

Given two strings, locate the position of the first character that is different between the two strings. Note that if one of the strings is empty (or both of them are empty), it returns 0.

Parameters:
  • left – one of the strings to compare.

  • right – one of the strings to compare.

Returns:

position of the first character that is different between the two compared strings.