Skip to content

mnemnion/StringUnits.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StringUnits

Stable Dev Build Status Aqua codecov

StringUnits.jl is a package which provides units for indexing strings: by codeunit, by character, by grapheme, and by textwidth.

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