close

紀錄一下strspn的用法

size_t strspn(const char *str1,const char *str2)
比對str1中的字元,去檢查哪一個字元不在str2中的字元集合裡,並回傳str1第一個不在str2字元集合裡的位置

ex.

str1 = "cheese";
str2 = "abcdefghi";

c -> in str2
h -> in str2
e -> in str2
s -> not in str2

so return value is 4


arrow
arrow
    全站熱搜
    創作者介紹
    創作者 jpsix 的頭像
    jpsix

    地瓜粥在讀書

    jpsix 發表在 痞客邦 留言(0) 人氣()