{"id":19648136,"url":"https://github.com/dimalmfao/strings","last_synced_at":"2025-04-03T15:17:38.769Z","repository":{"id":271792081,"uuid":"757283235","full_name":"dimalmfao/strings","owner":"dimalmfao","description":"A concise collection of static string functions poorly designed to enhance efficiency in C programming tasks.","archived":false,"fork":false,"pushed_at":"2024-08-09T14:14:19.000Z","size":44,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-09T04:11:15.211Z","etag":null,"topics":["c","contributions-welcome","open-source"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dimalmfao.png","metadata":{},"created_at":"2024-02-14T07:05:50.000Z","updated_at":"2025-01-08T17:38:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"1b893526-38b4-48b9-8cc0-6c31635d6e22","html_url":"https://github.com/dimalmfao/strings","commit_stats":null,"previous_names":["dimalmfao/strings"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimalmfao%2Fstrings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimalmfao%2Fstrings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimalmfao%2Fstrings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimalmfao%2Fstrings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dimalmfao","download_url":"https://codeload.github.com/dimalmfao/strings/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247024152,"owners_count":20870940,"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","contributions-welcome","open-source"],"created_at":"2024-11-11T14:47:14.223Z","updated_at":"2025-04-03T15:17:38.757Z","avatar_url":"https://github.com/dimalmfao.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# StringsLib: Static String Library for C Programming\n\nStringsLib is a lightweight static string library designed to simplify string manipulation tasks in C programming. This library provides a collection of functions and macros to handle common string operations efficiently.\n\n## Features\n\n- **Initialization:** Initialize strings from C-style strings or allocate memory for new strings.\n- **Deallocation:** Free memory allocated for strings to prevent memory leaks.\n- **Substrings:** Extract substrings from existing strings based on specified indices.\n- **Concatenation:** Concatenate multiple strings together to create a new string.\n- **Comparison:** Compare strings to determine their equality or relative order.\n- **Search:** Search for a specific character within a string.\n- **Tokenization:** Split strings into tokens based on a delimiter character.\n- **Cross-Type Compatibility:** Functions and macros support various string input types, including `String`, `String*`, and `char*`.\n\n## Usage\n\nTo use stringslib in your C project, follow these steps:\n\n1. Include the `strlib.h` header file in your source files:\n\n    ```c\n    #include \"strlib.h\"\n    ```\n\n2. Compile your project with the `strlib.c` file, which contains the implementation of stringslib functions:\n\n    ```bash\n    gcc -o your_program your_program.c strlib.c\n    ```\n\n3. Start using stringslib functions and macros in your code as needed.\n\n## Examples\n\n### Initializing Strings\n\n```c\nString str = init_string(\"Hello, world!\");\n```\n\n### Deallocating Strings\n\n```c\nString str = init_string(\"Hello, world!\");\ndeinit_string(\u0026str);\n```\n\n### Extracting Substrings\n\n```c\nString str = init_string(\"Hello, world!\");\nString substr = str_substring(0, 5, str);\n```\n\n### Concatenating Strings\n\n```c\nString str1 = init_string(\"Hello, \");\nString str2 = init_string(\"world!\");\nString concatenated = str_cat(str1, str2);\n```\n\n### Comparing Strings\n\n```c\nString str1 = init_string(\"hello\");\nString str2 = init_string(\"world\");\nint result = str_compare(str1, str2);\n```\n\n### Searching for Characters\n\n```c\nString str = init_string(\"hello\");\nchar* ptr = str_strchr(str, 'e');\n```\n\n### Tokenizing Strings\n\n```c\nchar* input = \"apple,orange,banana\";\nchar* delim = \",\";\nchar* token = str_tok(input, delim);\n```\n\nFeel free to contribute ;))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimalmfao%2Fstrings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdimalmfao%2Fstrings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimalmfao%2Fstrings/lists"}