Function rcutils_find_lastn

Function Documentation

size_t rcutils_find_lastn(const char *str, char delimiter, size_t string_length)

Return the last index of a character in a string of specifed length.

Identical to rcutils_find_last() but without relying on the string to be a null terminated c string.

Parameters:
  • str[in] string to search

  • delimiter[in] the character to search for

  • string_length[in] length of the string to search

Returns:

the index of the last occurence of the delimiter if found, or

Returns:

SIZE_MAX for invalid arguments, or

Returns:

SIZE_MAX if the delimiter is not found.