{"id":15049061,"url":"https://github.com/sharoniv0x86/stringwiz","last_synced_at":"2025-10-13T01:20:59.960Z","repository":{"id":223305643,"uuid":"759875023","full_name":"SharonIV0x86/StringWiz","owner":"SharonIV0x86","description":" A string utility library offering a comprehensive set of string manipulation functions.","archived":false,"fork":false,"pushed_at":"2024-04-28T15:36:23.000Z","size":73,"stargazers_count":4,"open_issues_count":4,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T01:50:02.248Z","etag":null,"topics":["c","c-language","c-programming-language","c-strings","library","strings"],"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/SharonIV0x86.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-02-19T13:59:34.000Z","updated_at":"2024-04-28T15:46:24.000Z","dependencies_parsed_at":"2024-02-19T15:27:34.700Z","dependency_job_id":"959e02d3-d59e-45fe-8460-e6ec56c481f2","html_url":"https://github.com/SharonIV0x86/StringWiz","commit_stats":null,"previous_names":["sharoniv0x86/stringwiz"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SharonIV0x86/StringWiz","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SharonIV0x86%2FStringWiz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SharonIV0x86%2FStringWiz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SharonIV0x86%2FStringWiz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SharonIV0x86%2FStringWiz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SharonIV0x86","download_url":"https://codeload.github.com/SharonIV0x86/StringWiz/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SharonIV0x86%2FStringWiz/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279013886,"owners_count":26085325,"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","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","c-language","c-programming-language","c-strings","library","strings"],"created_at":"2024-09-24T21:17:51.876Z","updated_at":"2025-10-13T01:20:59.943Z","avatar_url":"https://github.com/SharonIV0x86.png","language":"C","readme":"# String Wiz\n### A strings utility library providing basic to advanced string functions.\n\n## Table of Contents\n- [Installation](#installation)\n- [Contributing](#contributing)\n- [Developer's Note](#developers-note)\n- [Library Overview](#library-overview)\n- [Documentation and Features](#documentation)\n\n# Installation\nThe library for now is single-header only and does not require any prior set up.\njust download/copy and include the header file into your code and read the docs on usage.\n\n# Contributing\nContributors are welcomed add more strings related functions.\n- Raise an issue about the about feature you want to add and wait for it to assigned to you.\n- Or check any existing issue if you want to work on them [Issues](https://github.com/SharonIV0x86/StringWiz/issues) \n- Edit your code and open the PR, documentation will be taken care of. \n- Make sure to add block comments above your function.\n\n### Requirements\n1. ) Basics of C.\n2. ) Basics of Git/Github and pull request, forking.\n3. ) Passing string to function and returning string from functions.\n4. ) Basic of header files in C. \n\nIf you have any questions you can reach out to me on [discord](https://discord.com/users/1011937653203144715) or raise an issue.\n\n## Developer's Note\nThis project represents a small endeavor aimed at enhancing skills in string manipulation and memory allocation. It's intended to be a long-term project with ongoing maintenance and the addition of new features. While there may be some inconsistencies in the current codebase, future updates will address these and introduce even more functionality.\n\nYour contributions and feedback are highly appreciated as they play a crucial role in shaping the evolution of this project. Thank you for your support and stay tuned for exciting new features in the future!\n\n## Library Overview\n\n- str_malloc(int size)\n- str_free(char* str)\n- str_concat(const char* destination, const char* source)\n- str_substr(const char* str, int start, int length)\n- str_replace(const char* str, const char* old_sub, const char* new_sub)\n- str_to_upper(char* str)\n- str_to_lower(char* str)\n- str_cmp_ignore_case(const char* str1, const char* str2)\n- str_find(const char* str, const char* sub)\n- str_rfind(const char* str, const char* sub)\n- str_to_int(const char* str)\n- str_to_float(const char* str)\n- int_to_str(int num)\n- float_to_str(float num)\n- str_reverse(char* str)\n- str_trimWHS(char* str\n- str_format(const char* format, ...)\n- str_num(const char* str)\n- str_vow(const char* str)\n- str_conso(const char* str)\n# Documentation\n\n## char* str_malloc(int size)\nAllocates memory for a new string.\n    \n    Parameters:\n    size: The size of the memory to allocate.\n    Returns: A pointer to the allocated memory block.\n\n\n## void str_free(char* str)\nFrees memory allocated for a string.\n    \n    Parameters:\n        str: Pointer to the string to be freed.\n\n\n## char* str_concat(const char* str1, const char* str2)\nConcatenates two strings.\n    \n    Parameters:\n        str1: Pointer to the first string.\n        str2: Pointer to the second string.\n    Returns:\n        A pointer to the concatenated string.\n\nUsage:\n```c\nchar* result = str_concat(\"Hello, \", \"world!\");\nprintf(\"%s\\n\", result); // Output: Hello, world!\nstr_free(result);\n```\n## char* str_substr(const char* str, int start, int length)\nCreates a substring from a string.\n\n    Parameters:\n        str: Pointer to the original string.\n        start: Starting index of the substring.\n        length: Length of the substring.\n    Returns:\n        A pointer to the substring.\nUsage:\n\n```c\nchar* substring = str_substr(\"Hello, world!\", 7, 5);\nprintf(\"%s\\n\", substring); // Output: world\nstr_free(substring);\n```\n## char* str_replace(const char* str, const char* old_sub, const char* new_sub)\nReplaces occurrences of a substring in a string.\n\n    Parameters:\n        str: Pointer to the original string.\n        old_sub: Pointer to the substring to be replaced.\n        new_sub: Pointer to the replacement substring.\n    Returns:\n        A pointer to the modified string.\n\nUsage:\n```c\nchar* replaced = str_replace(\"Hello, world!\", \"world\", \"universe\");\nprintf(\"%s\\n\", replaced); // Output: Hello, universe!\nstr_free(replaced);\n```\n## void str_to_upper(char* str)\nConverts a string to uppercase.\n\n    Parameters:\n        str: Pointer to the string to be converted.\n\nUsage:\n```c\nchar str[] = \"hello, world!\";\nstr_to_upper(str);\nprintf(\"%s\\n\", str); // Output: HELLO, WORLD!\n```\n\n## void str_to_lower(char* str)\nConverts a string to lowercase.\n\n    Parameters:\n        str: Pointer to the string to be converted.\n\nUsage:\n```c\nchar str[] = \"HELLO, WORLD!\";\nstr_to_lower(str);\nprintf(\"%s\\n\", str); // Output: hello, world!\n```\n\n\n## int str_cmp_ignore_case(const char* str1, const char* str2)\nPerforms a case-insensitive string comparison.\n\n    Parameters:\n        str1: Pointer to the first string.\n        str2: Pointer to the second string.\n    Returns:\n        Negative value if str1 is less than str2.\n        Positive value if str1 is greater than str2.\n        Zero if str1 is equal to str2.\n        \n        Difference between the ASCII values if str1 and str2 are different\n        the first character that is encountered different in the two string,\n        it's difference is returned. Brace for unexpected output :) \nUsage:\n\n```c\nint result = str_cmp_ignore_case(\"Hello\", \"hello\");\nprintf(\"%d\\n\", result); // Output: 0\n```\n## int str_find(const char* str, const char* sub)\nFinds the first occurrence of a substring in a string.\n\n    Parameters:\n        str: Pointer to the original string.\n        sub: Pointer to the substring to search for.\n    Returns:\n        Index of the first occurrence of sub in str.\n        -1 if sub is not found in str.\nUsage:\n\n```c\nint index = str_find(\"hello, world!\", \"world\");\nprintf(\"%d\\n\", index); // Output: 7\n```\n\n## int str_rfind(const char* str, const char* sub)\nFinds the last occurrence of a substring in a string.\n\n    Parameters:\n        str: Pointer to the original string.\n        sub: Pointer to the substring to search for.\n    Returns:\n        Index of the last occurrence of sub in str.\n        -1 if sub is not found in str.\n\nUsage:\n```c\nint index = str_rfind(\"hello, world!\", \"o\");\nprintf(\"%d\\n\", index); // Output: 8\n```\n\n## int str_to_int(const char* str)\nConverts a string to an integer.\n\n    Parameters:\n        str: Pointer to the string to be converted.\n    Returns:\n        The integer value represented by the string.\n\nUsage:\n\n```c\nint num = str_to_int(\"123\");\nprintf(\"%d\\n\", num); // Output: 123\n```\n\n## float str_to_float(const char* str)\nConverts a string to a float.\n\n    Parameters:\n        str: Pointer to the string to be converted.\n    Returns:\n        The floating-point value represented by the string.\n\nUsage:\n```c\nfloat num = str_to_float(\"3.14\");\nprintf(\"%f\\n\", num); // Output: 3.140000\n```\n\n## char* int_to_str(int num)\n\n    Converts an integer to a string.\n    Parameters:\n        num: The integer to be converted.\n    Returns:\n        A pointer to the string representation of the integer.\n\nUsage:\n```c\nchar* str = int_to_str(123);\nprintf(\"%s\\n\", str); // Output: 123\nstr_free(str);\n```\n\n## char* float_to_str(float num)\nConverts a float to a string.\n\n    Parameters:\n        num: The float to be converted.\n    Returns:\n        A pointer to the string representation of the float.\n\nUsage:\n```c\nchar* str = float_to_str(3.14);\nprintf(\"%s\\n\", str); // Output: 3.140000\nstr_free(str);\n```\n## void str_reverse(char* str)\nReverses a string.\n\n    Parameters:\n        str: Pointer to the string to be reversed.\n\nUsage:\n```c\nchar str[] = \"hello, world!\";\nstr_reverse(str);\nprintf(\"%s\\n\", str); // Output: !dlrow ,olleh\n```\n\n## void str_trim(char* str)\nTrims whitespace characters from the beginning and end of a string.\n\n    Parameters:\n        str: Pointer to the string to be trimmed.\n\nUsage:\n```c\nchar str[] = \"  hello, world!  \";\nstr_trim(str);\nprintf(\"%s\\n\", str); // Output: hello, world!\n```\n## char* str_format(const char* format, ...)\nFormats a string using a format string and variable arguments.\n\n    Parameters:\n        format: The format string.\n        ...: Variable arguments to be formatted.\n    Returns:\n        A pointer to the formatted string.\n\nUsage:\n```c\nchar* formatted = str_format(\"%s %d %.2f\", \"Hello\", 123, 3.14159);\nprintf(\"%s\\n\", formatted); // Output: Hello 123 3.14\nstr_free(formatted);\n```\n## int str_num(const char *str)\nFunctions that returns the count of vowels in the string.\n\n    Parameters:\n        str: The string to find numbers in.\n    Returns:\n        Count of numbers in the string.\nUsage:\n```c\nchar strin = \"This is a test string 1234\";\nint num = num_str(strin);\nprintf(\"Count of numbers: %d\", num);\n```\n\n## int str_vow(const char *str)\nFunction that returns the vowels in the string\n\n    Parameters:\n        str: The string to find vowels in.\n    Returns:\n        Count of vowels in the string.\nUsage:\n```c\nchar strin = \"This is a test string 1234\";\nint vowels = str_vow(strin);\n```\n\n## str_conso(const char *str)\nFunction that returns the count of consonants in the string.\n\n    Parameters:\n        str: The string to find consonants in.\n    Returns:\n        Count of number of consonants in the string.\n\nUsage:\n```c\nchar strin = \"This is a test string 1235\";\nint consonants = str_conso(strin);\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharoniv0x86%2Fstringwiz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsharoniv0x86%2Fstringwiz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharoniv0x86%2Fstringwiz/lists"}