{"id":15061213,"url":"https://github.com/rgrinberg/stringext","last_synced_at":"2025-04-10T06:38:43.251Z","repository":{"id":15271980,"uuid":"18001279","full_name":"rgrinberg/stringext","owner":"rgrinberg","description":"Extra string functions for OCaml","archived":false,"fork":false,"pushed_at":"2023-01-21T06:47:18.000Z","size":108,"stargazers_count":21,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T07:41:14.177Z","etag":null,"topics":["ocaml","string","string-manipulation"],"latest_commit_sha":null,"homepage":null,"language":"OCaml","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/rgrinberg.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-22T03:32:24.000Z","updated_at":"2022-06-29T01:12:42.000Z","dependencies_parsed_at":"2023-02-12T08:15:45.971Z","dependency_job_id":null,"html_url":"https://github.com/rgrinberg/stringext","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgrinberg%2Fstringext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgrinberg%2Fstringext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgrinberg%2Fstringext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgrinberg%2Fstringext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rgrinberg","download_url":"https://codeload.github.com/rgrinberg/stringext/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248172235,"owners_count":21059507,"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":["ocaml","string","string-manipulation"],"created_at":"2024-09-24T23:11:46.995Z","updated_at":"2025-04-10T06:38:43.202Z","avatar_url":"https://github.com/rgrinberg.png","language":"OCaml","readme":"## Stringext -- Extra string functions fo OCaml\n\nExtra string functions for OCaml. Mainly splitting. All functions are in the\n`Stringext` module. Here's a snippet of most useful functions out of the mli:\n\n## Api Documentation\n\n```ocaml\n(** string_after [s] [n] returns the substring of [s] that is after\n    character [n] *)\nval string_after : string -\u003e int -\u003e string\n\n(** equivalent to [Str.quote] *)\nval quote : string -\u003e string\n\n(** split [?max] [s] [~on] splits [s] on every [on] occurence upto\n    [max] number of items if [max] is specified. [max] is assumed to\n    be a small number if specified. To not cause stack overflows *)\nval split : ?max:int -\u003e string -\u003e on:char -\u003e string list\n\n(** full_split [s] [~on] will split [s] on every occurence\n    of [on] but will add the separators between the tokens. Maintains\n    the invariant:\n\n    String.concat (full_split s ~on) =s *)\nval full_split : string -\u003e on:char -\u003e string list\n\n(** Trims spaces on the left of the string. In case no trimming is needed\n    the same string is returned without copying *)\nval trim_left : string -\u003e string\n\n(** split_strim_left [s] [~on] [~trim] splits [s] on every character\n    in [on]. Characters in [trim] are trimmed from the left of every\n    result element *)\nval split_trim_left : string -\u003e on:string -\u003e trim:string -\u003e string list\n\nval of_char : char -\u003e string\n\nval of_list : char list -\u003e string\n\nval to_list : string -\u003e char list\n\nval to_array : string -\u003e char array\n\nval of_array : char array -\u003e string\n\nval find_from : ?start:int -\u003e string -\u003e pattern:string -\u003e int option\n\nval replace_all : string -\u003e pattern:string -\u003e with_:string -\u003e string\n\nval replace_all_assoc : string -\u003e (string * string) list -\u003e string\n\nval cut : string -\u003e on:string -\u003e (string * string) option\n(** [String.cut on s] is either the pair [Some (l,r)] of the two\n    (possibly empty) substrings of [s] that are delimited by the first\n    match of the non empty separator string [on] or [None] if [on]\n    can't be matched in [s]. Matching starts from the beginning of [s].\n\n    The invariant [l ^ on ^ r = s] holds.\n\n    @raise Invalid_argument if [on] is the empty string. *)\n\nval rcut : string -\u003e on:string -\u003e (string * string) option\n(** [String.rcut on s] is like {!cut} but the matching is done backwards\n    starting from the end of [s].\n\n    @raise Invalid_argument if [on] is the empty string. *)\n\nval chop_prefix : string -\u003e prefix:string -\u003e string option\n\nval drop : string -\u003e int -\u003e string\n\nval take : string -\u003e int -\u003e string\n\n(** [trim_left_sub s ~pos ~len ~chars] Trim all characters inside [chars]\n    from [s] starting from [pos] and up to [len] *)\nval trim_left_sub : string -\u003e pos:int -\u003e len:int -\u003e chars:string -\u003e string\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgrinberg%2Fstringext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frgrinberg%2Fstringext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgrinberg%2Fstringext/lists"}