# StringIndex idea (Julia 2.0)

**URL:** <https://discourse.julialang.org/t/stringindex-idea-julia-2-0/107185>\
**Category:** Internals & Design\
**Tags:** strings, indexing\
**Created:** [December 5, 2023, 8:23pm UTC](https://discourse.julialang.org/t/stringindex-idea-julia-2-0/107185 "2023-12-05T20:23:43Z")\
**Posts on this page:** 1\
**Showing post:** 76

<div class="post-metadata">

**Author:** ![mnemnion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mnemnion/32/206596_2.png) [@mnemnion](https://discourse.julialang.org/u/mnemnion)\
**Post date:** [March 27, 2024, 10:11pm UTC](https://discourse.julialang.org/t/stringindex-idea-julia-2-0/107185/76 "2024-03-27T22:11:11Z")

</div>

> [@mnemnion](#):
>
> But a syntax such as `string[1ch:5ch]`, `string[1gr:5gr]`, `string[1wc:5wc]` is a nicely-compact way to generate those sorts of index. `wc` because of the `wcwidth` function which never quite made it into the C standard, it could be `1tw` to remind users that it’s using the `textwidth` function under the hood. I think this is fitting because the various approaches to indexing are effectively units, and this looks like a unit, and units are a place where highly-abbreviated names are considered acceptable, no one insists on `1m` being spelled `1meter`.

So I went ahead and [implemented this](https://discourse.julialang.org/t/ann-stringunits-jl/112202).

---

_[View the full topic](https://discourse.julialang.org/t/stringindex-idea-julia-2-0/107185)._
