# Left and right division for strings

**URL:** <https://discourse.julialang.org/t/left-and-right-division-for-strings/109839>\
**Category:** Internals & Design\
**Tags:** strings, arithmetic\
**Created:** [February 6, 2024, 9:31pm UTC](https://discourse.julialang.org/t/left-and-right-division-for-strings/109839 "2024-02-06T21:31:04Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [February 6, 2024, 9:48pm UTC](https://discourse.julialang.org/t/left-and-right-division-for-strings/109839/10 "2024-02-06T21:48:11Z")

</div>

> [@Mason](#):
>
> `s[begin:end-3]`

Note also that this is buggy:

```julia
julia> s = "α.jl"
"α.jl"

julia> s[begin:end-3]
ERROR: StringIndexError: invalid index [2], valid nearby indices [1]=>'α', [3]=>'.'

```

(It’s really tempting to write this, which is a key motivation for a [`StringIndex` type](https://discourse.julialang.org/t/stringindex-idea-julia-2-0/107185).)

---

_[View the full topic](https://discourse.julialang.org/t/left-and-right-division-for-strings/109839)._
