# Julia why the output is 4:4 of the function findnext

**URL:** <https://discourse.julialang.org/t/julia-why-the-output-is-4-4-of-the-function-findnext/102678>\
**Category:** General Usage\
**Tags:** question\
**Created:** [August 10, 2023, 12:27pm UTC](https://discourse.julialang.org/t/julia-why-the-output-is-4-4-of-the-function-findnext/102678 "2023-08-10T12:27:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![saampandit](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/saampandit/32/52335_2.png) [@saampandit](https://discourse.julialang.org/u/saampandit)\
**Post date:** [August 10, 2023, 12:27pm UTC](https://discourse.julialang.org/t/julia-why-the-output-is-4-4-of-the-function-findnext/102678/1 "2023-08-10T12:27:52Z")

</div>

I am new to Julia why the function is returning value 4:4 what does it means ??

```plaintext
findnext("o", "xylophone", 1)

```

---

<div class="post-metadata">

**Author:** ![jakobnissen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jakobnissen/32/13477_2.png) [@jakobnissen](https://discourse.julialang.org/u/jakobnissen)\
**Post date:** [August 10, 2023, 12:43pm UTC](https://discourse.julialang.org/t/julia-why-the-output-is-4-4-of-the-function-findnext/102678/2 "2023-08-10T12:43:26Z")

</div>

It means that the first occurrence of query string `"o"` after index 1 in `"xylophone"` occurs at indexes `4:4` - that is, the indices from 4 up to and including 4:

```julia
julia> "xylophone"[4:4]
"o"

```

---

<div class="post-metadata">

**Author:** ![adienes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adienes/32/37459_2.png) [@adienes](https://discourse.julialang.org/u/adienes)\
**Post date:** [August 10, 2023, 12:47pm UTC](https://discourse.julialang.org/t/julia-why-the-output-is-4-4-of-the-function-findnext/102678/3 "2023-08-10T12:47:30Z")

</div>

> [@saampandit](#):
>
> `findnext("o", "xylophone", 1)`

also note

```julia
julia> findnext('o', "xylophone", 1)
4

```

This is not a bug — it’s an intentional difference between strings and characters
