# Nonallocating readuntil functionality?

**URL:** <https://discourse.julialang.org/t/nonallocating-readuntil-functionality/45746>\
**Category:** General Usage\
**Created:** [August 29, 2020, 2:17pm UTC](https://discourse.julialang.org/t/nonallocating-readuntil-functionality/45746 "2020-08-29T14:17:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ahmed\_Salih](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ahmed_salih/32/206579_2.png) [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Post date:** [August 29, 2020, 2:17pm UTC](https://discourse.julialang.org/t/nonallocating-readuntil-functionality/45746/1 "2020-08-29T14:17:52Z")

</div>

Hello!

Using readuntil I found that it allocates (even though I have no need for it to do so).

Reading on Github I found this post mentioning skipchars [https://github.com/JuliaLang/julia/pull/36160](https://github.com/JuliaLang/julia/pull/36160)

But in my case I need to use a string, which skipchars does not support as far as I understand. So my question is:

Would anyone of you happen to have a custom functionality to readuntil without allocation? I basically use it to find a string and move to the correct location in a file.

Kind regards

---

<div class="post-metadata">

**Author:** ![Ahmed\_Salih](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ahmed_salih/32/206579_2.png) [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Post date:** [August 29, 2020, 7:56pm UTC](https://discourse.julialang.org/t/nonallocating-readuntil-functionality/45746/2 "2020-08-29T19:56:14Z")

</div>

For those who might be interested in this in the future, instead consider reading the whole file and do as explained by @stevengj here:

# [Finding position of a sequence in a UInt8 array?](https://discourse.julialang.org/t/finding-position-of-a-sequence-in-a-uint8-array/45757)

This will do 1 allocation, which is better than the about 20ish I got before

Kind regards
