---
name: "byte_chr"
section: "3"
platform: "linux"
package: "libowfat-dev"
version: "0.32-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/byte_chr"
---

# byte\_chr(3)

search for a byte in a string

## NAME

byte\_chr - search for a byte in a string

## SYNTAX

**#include \<libowfat/byte.h\>**

size\_t **byte\_chr**(const char \**haystack*,size\_t *len*,char *needle*);

## DESCRIPTION

*byte\_chr* returns the smallest integer *i* between 0 and *len*-1 inclusive such that *one*\[*i*\] equals *needle*.

If no such integer exists, byte\_chr returns *len*.

byte\_chr may read all bytes *one*\[0\], *one*\[1\], ..., *one*\[*len*-1\], even if not all the bytes are relevant to the answer.

## SEE ALSO

[byte\_rchr(3)](/byte_rchr/3.md)
