strchr, strrchr, strchrnul - localizan un carácter en una cadena
Biblioteca Estándar C (libc, -lc)
#include <string.h>
char *strchr(const char *s, int c);
char *strrchr(const char *s, int c);
#define _GNU_SOURCE /* Vea feature_test_macros(7) */
#include <string.h>
char *strchrnul(const char *s, int c);
La función strchr() devuelve un puntero a la primera ocurrencia del carácter c en la cadena de caracteres s.
La función strrchr() devuelve un puntero a la última ocurrencia del carácter c en la cadena s.
The strchrnul() function is like strchr() except that if c is not found in s, then it returns a pointer to the null byte at the end of s, rather than NULL.
Aquí "carácter" quiere decir "byte" - estas funciones no funcionan con caracteres anchos o multi-byte.
The strchr() and strrchr() functions return a pointer to the matched character or NULL if the character is not found. The terminating null byte is considered part of the string, so that if c is specified as '\0', these functions return a pointer to the terminator.
La función strchrnul() devuelve un puntero al elemento de la cadena con el carácter coincidente, o NULL si s, es decir s+strlen(s), si el carácter no se ha encontrado.
strchrnul() se ha añadido en la versión 2.1.1 de glibc.
Para obtener una explicación de los términos usados en esta sección, véase attributes(7)EN.
| Interfaz | Atributo | Valor |
| strchr(), strrchr(), strchrnul() | Seguridad del hilo | Multi-hilo seguro |
strchr(), strrchr(): POSIX.1-2001, POSIX.1-2008, C99, SVr4, 4.3BSD.
strchrnul() es una extensión GNU.
La traducción al español de esta página del manual fue creada por Gerardo Aburruzaga García <gerardo.aburruzaga@uca.es> y Marcos Fouces <marcos@debian.org>
Esta traducción es documentación libre; lea la GNU General Public License Version 3 o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD.
Si encuentra algún error en la traducción de esta página del manual, envíe un correo electrónico a debian-l10n-spanish@lists.debian.org.