https://github.com/mnemnion/stringunits.jl
Unit Types for Indexing Strings
https://github.com/mnemnion/stringunits.jl
indexing string-manipulations strings unicode
Last synced: 11 months ago
JSON representation
Unit Types for Indexing Strings
- Host: GitHub
- URL: https://github.com/mnemnion/stringunits.jl
- Owner: mnemnion
- License: mit
- Created: 2024-03-24T15:45:55.000Z (about 2 years ago)
- Default Branch: trunk
- Last Pushed: 2024-12-23T15:03:07.000Z (over 1 year ago)
- Last Synced: 2025-07-05T12:19:51.294Z (11 months ago)
- Topics: indexing, string-manipulations, strings, unicode
- Language: Julia
- Homepage: https://mnemnion.github.io/StringUnits.jl/
- Size: 202 KB
- Stars: 16
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# StringUnits
[](https://mnemnion.github.io/StringUnits.jl/stable/)
[](https://mnemnion.github.io/StringUnits.jl/dev/)
[](https://github.com/mnemnion/StringUnits.jl/actions/workflows/CI.yml?query=branch%3Atrunk)
[](https://github.com/JuliaTesting/Aqua.jl)
[](https://codecov.io/gh/mnemnion/StringUnits.jl)
**StringUnits.jl** is a package which provides units for indexing strings: by
codeunit, by character, by grapheme, and by textwidth.
```jldoctest
julia> str = "aλ🤔∅👨🏻🌾!"
"aλ🤔∅👨🏻\u200d🌾!"
julia> str[3ch]
'🤔': Unicode U+1F914 (category So: Symbol, other)
julia> str[1cu]
0x61
julia> str[5gr]
"👨🏻\u200d🌾"
julia> str[2ch:4ch]
"λ🤔∅"
julia> str[2ch:5ch + 0gr]
"λ🤔∅👨🏻\u200d🌾"
```
For details, see the [documentation](https://mnemnion.github.io/StringUnits.jl/)