{"id":16498864,"url":"https://github.com/denius/fortranstrings.jl","last_synced_at":"2026-03-04T20:02:23.897Z","repository":{"id":61797973,"uuid":"302541252","full_name":"denius/FortranStrings.jl","owner":"denius","description":"Strings like in Fortran","archived":false,"fork":false,"pushed_at":"2020-10-14T00:01:50.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-29T14:46:43.619Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Julia","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/denius.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}},"created_at":"2020-10-09T05:26:21.000Z","updated_at":"2020-10-13T20:16:45.000Z","dependencies_parsed_at":"2022-10-21T11:15:24.038Z","dependency_job_id":null,"html_url":"https://github.com/denius/FortranStrings.jl","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/denius/FortranStrings.jl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denius%2FFortranStrings.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denius%2FFortranStrings.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denius%2FFortranStrings.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denius%2FFortranStrings.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/denius","download_url":"https://codeload.github.com/denius/FortranStrings.jl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denius%2FFortranStrings.jl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30091570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T19:41:02.502Z","status":"ssl_error","status_checked_at":"2026-03-04T19:40:05.550Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-10-11T14:50:22.074Z","updated_at":"2026-03-04T20:02:23.800Z","avatar_url":"https://github.com/denius.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FortranStrings\n\n[![Build Status](https://travis-ci.com/denius/FortranStrings.jl.svg?branch=master)](https://travis-ci.com/denius/FortranStrings.jl)\n[![Coverage](https://codecov.io/gh/denius/FortranStrings.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/denius/FortranStrings.jl)\n\n`FortranStrings.jl` is a datatype for Fortran strings emulation. These strings have two main points:\n* `FortranString` is mutable (but not resizable)\n* flexibility in assignment: can truncate or fill the right side with spaces if the length is not coincide.\n\nThe original Fortran strings are composed of the 1-byte elements. To create such strings:\n```julia\ns = FortranString{UInt8}(\"ABC\")\n```\nor, the same with the shorthand macro `@F8_str`:\n```julia\ns = F8\"ABC\"\n```\nIt is also possible to create strings with `Char` elements, or any other:\n`str = FortranString{Char}(\"ABC\")` (or `str = F\"ABC\"`), `S = FortranString{UInt64}(\"ABC\")`.\n\nAssignment must be done element-wise with `.=`. Other element-wise operations (`.`) are supported also.\n```julia\njulia\u003e s = F8\"ABC\"\nF8\"ABC\"\n\njulia\u003e s .= \"abc\"\nF8\"abc\"\n\njulia\u003e s .= \"DE\"\nF8\"DE \"\n\njulia\u003e s .= \"f\" * \"abc\"\nF8\"fab\"\n\njulia\u003e str = F\"ABC\"\nF\"ABC\"\n\njulia\u003e str .+= 1\nF\"BCD\"\n\njulia\u003e str[2:3] .= s[1:3]\n2-element view(::FortranString{Char}, 2:3) with eltype Char:\n 'f': ASCII/Unicode U+0066 (category Ll: Letter, lowercase)\n 'a': ASCII/Unicode U+0061 (category Ll: Letter, lowercase)\n\njulia\u003e str\nF\"Bfa\"\n\njulia\u003e @btime $s .= uppercase.($s)\n  11.272 ns (0 allocations: 0 bytes)\nF8\"FAB\"\n```\nInternally, the `FortranString{T}` is just a wrapper for `Vector{T}` with a bunch of broadcasting routines.\n\n## Quotes escaping\nIn Fortran strings, the quotes with which the strings were created must be escaped by doubling, for example Fortran's: `'Can''t be with only single quote inside'` or `\"Should be \"\"doubled\"\"\"`. To simplify conversion from Fortran the escape flag `qq` or `d` has been introduced:\n```julia\njulia\u003e str = F\"Should be \\\"\\\"doubled\\\"\\\"\"d\nF\"Should be \\\"doubled\\\"\"\n```\nSimilarly, using the `q` flag, single quotes should be doubled:\n```julia\njulia\u003e s = F\"Can''t be with only single quote inside\"\nF\"Can't be with only single quote inside\"\n```\nAlthough, in both cases, the escaping-doubling is not necessary when using the `q` or` qq` flags, because single `'` or `\"` produce single ones.\n\nAll this escaping only works when the `FortranString` is created from `String`, and this does not apply when a string is created from an `Vector`:\n```julia\njulia\u003e FortranString{Char}([0x27, 0x27, 0x61, 0x62, 0x63, 0x27, 0x27])\nF\"''abc''\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenius%2Ffortranstrings.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdenius%2Ffortranstrings.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenius%2Ffortranstrings.jl/lists"}