strspn

strspn --  マスクに一致する最初のセグメントの長さを返す

説明

int strspn(string str1, string str2);

str1 の中で全て str2 の文字からなる最初のセグメントの 長さを返します。

strcspn も参照下さい。