Scroll to navigation

STRCHR(3) Manual del Programador de Linux STRCHR(3)

NOMBRE

strchr, strrchr, strchrnul - localizan un carácter en una cadena de ellos

SINOPSIS

#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);

DESCRIPCIÓN

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 carácteres anchos o multi-byte.

VALOR DEVUELTO

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.

The strchrnul() function returns a pointer to the matched character, or a pointer to the null byte at the end of s (i.e., s+strlen(s)) if the character is not found.

VERSIONES

strchrnul() first appeared in glibc in version 2.1.1.

ATRIBUTOS

Para obtener una explicación de los términos usados en esta sección, véase attributes(7).

Interfaz Atributo Valor
strchr(), strrchr(), strchrnul() Seguridad del hilo Multi-hilo seguro

CONFORME A

strchr(), strrchr(): POSIX.1-2001, POSIX.1-2008, C89, C99, SVr4, 4.3BSD.

strchrnul() es una extensión GNU.

VÉASE TAMBIÉN

index(3), memchr(3), rindex(3), string(3), strlen(3), strpbrk(3), strsep(3), strspn(3), strstr(3), strtok(3), wcschr(3), wcsrchr(3)

COLOFÓN

Esta página es parte de la versión 5.10 del proyecto Linux man-pages. Puede encontrar una descripción del proyecto, información sobre cómo informar errores y la última versión de esta página en https://www.kernel.org/doc/man-pages/.

TRADUCCIÓN

La traducción al español de esta página del manual fue creada por Gerardo Aburruzaga García <gerardo.aburruzaga@uca.es>

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.

6 Marzo 2019 GNU