# Case-insensitive prefix/suffix stripping

**URL:** <https://discourse.julialang.org/t/case-insensitive-prefix-suffix-stripping/109871>\
**Category:** General Usage\
**Tags:** strings, regex\
**Created:** [February 7, 2024, 11:44am UTC](https://discourse.julialang.org/t/case-insensitive-prefix-suffix-stripping/109871 "2024-02-07T11:44:25Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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 7, 2024, 12:38pm UTC](https://discourse.julialang.org/t/case-insensitive-prefix-suffix-stripping/109871/2 "2024-02-07T12:38:37Z")

</div>

> [@Palli](#):
>
> Neither works, but could be added, no breaking change, but my issue is that a straightforward extension is problematic. […] But this would miss some cases such as “hTtP”. I.e. there are exponentially many cases, here 16 to check for if chop functions aren’t made case-insensitive.

For that sort of thing you could use a regex: `replace(s, r"^https?://"i => "")` instead of `chopprefix`, for example.

---

_[View the full topic](https://discourse.julialang.org/t/case-insensitive-prefix-suffix-stripping/109871)._
