tail head cat sleep
QR code linking to this page

manページ  — INDEX

名称

index – 文字列中の文字位置の特定

内容

ライブラリ

Standard C Library (libc, -lc)

書式

#include <string.h>

char *
index(const char *s, int c);

解説

index() 関数は、ナル文字で終了する文字列 s から c ( char 型に変換) に一致する最初の文字位置を調べます。

戻り値

該当する文字が発見された場合、該当する文字へのポインタを返し、 見つからなかった場合は NULL を返します。 c が '\0' の時、 index() は文字列の最後の '\0' の位置を調べます。

関連項目

memchr(3), rindex(3), strchr(3), strcspn(3), strpbrk(3), strrchr(3), strsep(3), strspn(3), strstr(3), strtok(3)

歴史

index() 関数は、 AT&T v6 で登場しました。

INDEX (3) June 4, 1993

tail head cat sleep
QR code linking to this page


このマニュアルページサービスについてのご意見は Ben Bullock にお知らせください。 Privacy policy.

This philosophy, in the hands of amateurs, leads to inexplicably mind-numbing botches like the existence of two programs, “head” and “tail,” which print the first part or the last part of a file, depending. Even though their operations are duals of one another, “head” and “tail” are different programs, written by different authors, and take different options!
— The Unix Haters' handbook