{"id":15749703,"url":"https://github.com/KSXGitHub/split-char-from-str","last_synced_at":"2025-10-15T05:31:05.296Z","repository":{"id":156059142,"uuid":"632850029","full_name":"KSXGitHub/split-char-from-str","owner":"KSXGitHub","description":"A small utility to split a string into the first or last character (type `char`) and the rest (type `\u0026str`)","archived":false,"fork":false,"pushed_at":"2024-10-18T20:11:49.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-20T08:10:05.974Z","etag":null,"topics":["no-std","parser","rust","string","text-processing"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/split-char-from-str","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KSXGitHub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2023-04-26T09:01:14.000Z","updated_at":"2024-10-18T19:45:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"95d8ac83-a0de-4841-a5a2-3bb59f6edd7e","html_url":"https://github.com/KSXGitHub/split-char-from-str","commit_stats":null,"previous_names":["ksxgithub/split-char-from-str","ksxgithub/split-first-char"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KSXGitHub%2Fsplit-char-from-str","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KSXGitHub%2Fsplit-char-from-str/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KSXGitHub%2Fsplit-char-from-str/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KSXGitHub%2Fsplit-char-from-str/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KSXGitHub","download_url":"https://codeload.github.com/KSXGitHub/split-char-from-str/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236581032,"owners_count":19172267,"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":["no-std","parser","rust","string","text-processing"],"created_at":"2024-10-04T06:04:29.939Z","updated_at":"2025-10-15T05:31:00.050Z","avatar_url":"https://github.com/KSXGitHub.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Split Char From Str\n\nA small utility to split a string into the first or last character (type `char`) and the rest (type `\u0026str`)\n\n## Usage\n\n### Function call\n\n```rust\nuse split_char_from_str::split_first_char;\nlet (first_char, rest) = split_first_char(\"abc\").unwrap();\nassert_eq!(first_char, 'a');\nassert_eq!(rest, \"bc\");\n```\n\n```rust\nuse split_char_from_str::split_last_char;\nlet (rest, last_char) = split_last_char(\"abc\").unwrap();\nassert_eq!(rest, \"ab\");\nassert_eq!(last_char, 'c');\n```\n\n### Method call\n\n```rust\nuse split_char_from_str::SplitCharFromStr;\nlet (first_char, rest) = \"abc\".split_first_char().unwrap();\nassert_eq!(first_char, 'a');\nassert_eq!(rest, \"bc\");\n```\n\n```rust\nuse split_char_from_str::SplitCharFromStr;\nlet (rest, last_char) = \"abc\".split_last_char().unwrap();\nassert_eq!(rest, \"ab\");\nassert_eq!(last_char, 'c');\n```\n\n## Alternative\n\nIf you don't need the first character to be a `char`, just use `str.split_at(1)`, it will return a tuple of 2 strings.\n\n## License\n\n[MIT](https://github.com/KSXGitHub/split-char-from-str/blob/master/LICENSE.md) © [Hoàng Văn Khải](https://github.com/KSXGitHub/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKSXGitHub%2Fsplit-char-from-str","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FKSXGitHub%2Fsplit-char-from-str","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKSXGitHub%2Fsplit-char-from-str/lists"}