美文网首页
C语言字符串分割

C语言字符串分割

作者: 锋之律 | 来源:发表于2020-12-24 09:52 被阅读0次

    一. strtok(),用于字符串分割

    char *strtok(char *str, const char *delim)
    str -- 要被分解成一组小字符串的字符串。
    delim -- 包含分隔符的 C 字符串。

    二、sscanf()

    int sscanf(const char *str, const char *format, ...)

    三、strstr(),用于字符串检索

    char *strstr(const char *haystack, const char *needle)
    haystack -- 要被检索的 C 字符串。
    needle -- 在 haystack 字符串内要搜索的小字符串。

    相关文章

      网友评论

          本文标题:C语言字符串分割

          本文链接:https://www.haomeiwen.com/subject/gjnpnktx.html