rcutils
master
C API providing common utilities and data structures.
|
Go to the source code of this file.
Functions | |
size_t | rcutils_find (const char *str, char delimiter) |
Return the first index of a character in a string. More... | |
size_t | rcutils_findn (const char *str, char delimiter, size_t string_length) |
Return the first index of a character in a string of specified length. More... | |
size_t | rcutils_find_last (const char *str, char delimiter) |
Return the last index of a character in a string. More... | |
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. More... | |
size_t rcutils_find | ( | const char * | str, |
char | delimiter | ||
) |
Return the first index of a character in a string.
Search in a string for the first occurence of a delimiter.
[in] | str | null terminated c string to search |
[in] | delimiter | the character to search for |
SIZE_MAX
for invalid arguments or if the delimiter is not found size_t rcutils_findn | ( | const char * | str, |
char | delimiter, | ||
size_t | string_length | ||
) |
Return the first index of a character in a string of specified length.
Identical to rcutils_find_first() but without relying on the string to be a null terminated c string.
[in] | str | string to search |
[in] | delimiter | the character to search for |
[in] | string_length | length of the string to search |
SIZE_MAX
for invalid arguments or if the delimiter is not found size_t rcutils_find_last | ( | const char * | str, |
char | delimiter | ||
) |
Return the last index of a character in a string.
Search in a string for the last occurence of a delimiter.
[in] | str | null terminated c string to search |
[in] | delimiter | the character to search for |
SIZE_MAX
for invalid arguments or if the delimiter is not found 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.
[in] | str | string to search |
[in] | delimiter | the character to search for |
[in] | string_length | length of the string to search |
SIZE_MAX
for invalid arguments or if the delimiter is not found