{"id":20569651,"url":"https://github.com/virgula0/c-string-splitter","last_synced_at":"2026-04-12T23:49:03.246Z","repository":{"id":168591103,"uuid":"291332827","full_name":"Virgula0/c-string-splitter","owner":"Virgula0","description":"String splitter for c language just like split methods given by default by the majority of OOP languages.","archived":false,"fork":false,"pushed_at":"2020-10-17T13:30:05.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-06T09:46:49.148Z","etag":null,"topics":["c","library","linux","osx","split","split-methods","string-splitter","strings","utility"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Virgula0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-29T19:08:11.000Z","updated_at":"2020-10-17T13:30:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"06680c2a-14cd-4071-b425-4bc6842c5f2d","html_url":"https://github.com/Virgula0/c-string-splitter","commit_stats":null,"previous_names":["virgula0/c-string-splitter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Virgula0/c-string-splitter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Virgula0%2Fc-string-splitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Virgula0%2Fc-string-splitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Virgula0%2Fc-string-splitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Virgula0%2Fc-string-splitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Virgula0","download_url":"https://codeload.github.com/Virgula0/c-string-splitter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Virgula0%2Fc-string-splitter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263389488,"owners_count":23459406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","library","linux","osx","split","split-methods","string-splitter","strings","utility"],"created_at":"2024-11-16T05:09:05.974Z","updated_at":"2026-04-12T23:48:58.220Z","avatar_url":"https://github.com/Virgula0.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# c-string-splitter\nString splitter for c language just like split methods given by default by the majority of OOP languages.\n\nSince i never found an easy implemantion and already well-coded function for split strings in c i build my own version.\nThis script avoid the use of functions like ```strtok``` wich modifies the original passed string to the function. Example of some problems when using strtok: [StackOverflow](https://stackoverflow.com/questions/63151324/segmentation-fault-returned-using-strtok/63151617).\n\nInstead with this function, the passed string will not be manipulated.\n\n# Usage\nInclude ```splitter.h``` in your code.\n```c\n#include \"splitter.h\"\n\nint main(){\n\tchar *string = \"this|is|a|long|string|which|needs|to|be|splitted\\n\";\n\tchar ** strings = split(string,'|');\n\tint count = 0;\n\tprintf(\"\\nOriginal one: %s\",string);\n\tprintf(\"Splitted:\");\n\twhile (*strings){\n\t\tprintf(\" %s\",*strings++);\n\t\tcount++;\n\t}\n\tprintf(\"Original one not touched: %s\\n\",string);\n\n\t//remember to deallocate once finished\n\tif (strings){\n\t\tstrings -= count;\n\t\tfree(strings);\n\t}\n}\n```\n\n# MakeExample\n\nCompile the example given with:\n\n```\nmake\n./main\n```\n\n![img](https://i.imgur.com/DNLVel3.png)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvirgula0%2Fc-string-splitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvirgula0%2Fc-string-splitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvirgula0%2Fc-string-splitter/lists"}