# Split() won't Split?

**URL:** <https://connect.superhuman.com/t/split-wont-split/13351>\
**Category:** Ask the Community\
**Created:** [January 19, 2020, 11:19pm UTC](https://connect.superhuman.com/t/split-wont-split/13351 "2020-01-19T23:19:45Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johg\_Ananda](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/johg_ananda/32/13930_2.png) [@Johg\_Ananda](https://connect.superhuman.com/u/Johg_Ananda)\
**Post date:** [January 19, 2020, 11:19pm UTC](https://connect.superhuman.com/t/split-wont-split/13351/1 "2020-01-19T23:19:45Z")

</div>

I want to take some URLs and chop off all the tracking. I noticed in the URLs the mess comes after the ?

> **[Daemon](https://www.audible.com/pd/Daemon-Audiobook/B002V5B9SO?pf_rd_p=6a5ce8e4-798e-4a64-8bc5-71dcf66d673f&pf_rd_r=1ZDSSVFBR7B6F32RF5KD&ref=a_lib_c4_libItem_B002V5B9SO)**
>
> Check out this great listen on Audible.com. Daniel Suarez's New York Times best-selling debut high-tech thriller is “so frightening even the government has taken note” (Entertainment Weekly). 
> Daemons: computer programs that silently run in the...

To pull up the book I only need: [https://www.audible.com/pd/Daemon-Audiobook/B002V5B9SO](https://www.audible.com/pd/Daemon-Audiobook/B002V5B9SO)

Me thought it clever to `split()` the array and then take `first()`. For some reason it won’t split! After question mark wouldn’t work I thought maybe ‘/’ - see below. Thoughts?

 ![Screen Shot 2020-01-19 at 3.16.54 PM](https://global.discourse-cdn.com/coda1/original/2X/1/14dce09e53d8ebc4e63386dbf8c9520196317db4.png)

---

<div class="post-metadata">

**Author:** ![Federico\_Stefanato](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/federico_stefanato/32/10092_2.png) [@Federico\_Stefanato](https://connect.superhuman.com/u/Federico_Stefanato)\
**Post date:** [January 19, 2020, 11:35pm UTC](https://connect.superhuman.com/t/split-wont-split/13351/2 "2020-01-19T23:35:01Z")

</div>

Hi @Johg_Ananda,

I’m not able to reproduce it…  
What is the actual content of the cell?  
Have you tried with `Link.toText().Split("/")`?

---

<div class="post-metadata">

**Author:** ![Johg\_Ananda](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/johg_ananda/32/13930_2.png) [@Johg\_Ananda](https://connect.superhuman.com/u/Johg_Ananda)\
**Post date:** [January 19, 2020, 11:39pm UTC](https://connect.superhuman.com/t/split-wont-split/13351/3 "2020-01-19T23:39:57Z")

</div>

@Federico_Stefanato !!! yes it needed to be converted to text. Although I pasted it in as text, Coda did an end run and transformed it into not-text. Thank you! 🙏

---

<div class="post-metadata">

**Author:** ![Federico\_Stefanato](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/federico_stefanato/32/10092_2.png) [@Federico\_Stefanato](https://connect.superhuman.com/u/Federico_Stefanato)\
**Post date:** [January 19, 2020, 11:47pm UTC](https://connect.superhuman.com/t/split-wont-split/13351/4 "2020-01-19T23:47:46Z")

</div>

Great!  
Even though if you need to take out the query parameters, maybe it’s easier go with [Left()](https://coda.io/formulas#Left) and [Find()](https://coda.io/formulas#Find) functions searching for the “`?`”.  
Unfortunately, [RegexReplace()](https://coda.io/formulas#RegexReplace) cannot work with groups (please, somebody tell me otherwise); it would have been a good candidate.

Cheers!

---

<div class="post-metadata">

**Author:** ![Johg\_Ananda](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/johg_ananda/32/13930_2.png) [@Johg\_Ananda](https://connect.superhuman.com/u/Johg_Ananda)\
**Post date:** [January 20, 2020, 12:14am UTC](https://connect.superhuman.com/t/split-wont-split/13351/5 "2020-01-20T00:14:07Z")

</div>

Any reason you think `left()` + `find()` are better than `split()` & `first()`?

---

<div class="post-metadata">

**Author:** ![Federico\_Stefanato](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/federico_stefanato/32/10092_2.png) [@Federico\_Stefanato](https://connect.superhuman.com/u/Federico_Stefanato)\
**Post date:** [January 20, 2020, 7:21am UTC](https://connect.superhuman.com/t/split-wont-split/13351/6 "2020-01-20T07:21:40Z")

</div>

Well, just common sense.  
I guess that splitting an URL in slashes and taking the first occurrence would return “`http`:” 😬  
You’re not searching for “/” but for “?”, as far as I understood.

If you need a string _before_ a certain string/character, it is usually better search for the occurrence and cut it after.

Does it make sense?

Cheers!

---

<div class="post-metadata">

**Author:** ![Federico\_Stefanato](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/federico_stefanato/32/10092_2.png) [@Federico\_Stefanato](https://connect.superhuman.com/u/Federico_Stefanato)\
**Post date:** [January 20, 2020, 7:54am UTC](https://connect.superhuman.com/t/split-wont-split/13351/7 "2020-01-20T07:54:51Z")

</div>

Just realised that perhaps you intended splitting by “`?`”.  
Which does work 🙃

---

<div class="post-metadata">

**Author:** ![Paul\_Danyliuk](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/paul_danyliuk/32/27228_2.png) [@Paul\_Danyliuk](https://connect.superhuman.com/u/Paul_Danyliuk)\
**Post date:** [January 20, 2020, 1:45pm UTC](https://connect.superhuman.com/t/split-wont-split/13351/8 "2020-01-20T13:45:09Z")

</div>

> [@Federico\_Stefanato](#):
>
> Unfortunately, [RegexReplace()](https://coda.io/formulas#RegexReplace) cannot work with groups (please, somebody tell me otherwise)

Ahem 🙂

 ![image](https://global.discourse-cdn.com/coda1/original/2X/f/f75d19ee51e618f8181440cf05c41837da9b7033.png)

---

<div class="post-metadata">

**Author:** ![Federico\_Stefanato](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/federico_stefanato/32/10092_2.png) [@Federico\_Stefanato](https://connect.superhuman.com/u/Federico_Stefanato)\
**Post date:** [January 20, 2020, 1:49pm UTC](https://connect.superhuman.com/t/split-wont-split/13351/9 "2020-01-20T13:49:36Z")

</div>

> [@Paul\_Danyliuk](#):
>
> image775×119 9.32 KB

Well,  
thank **somebody** , then! 😄

Thanks a lot @Paul_Danyliuk: I actually never dug into that.  
Happy to know it does work

---

<div class="post-metadata">

**Author:** ![Paul\_Danyliuk](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/paul_danyliuk/32/27228_2.png) [@Paul\_Danyliuk](https://connect.superhuman.com/u/Paul_Danyliuk)\
**Post date:** [January 20, 2020, 1:54pm UTC](https://connect.superhuman.com/t/split-wont-split/13351/10 "2020-01-20T13:54:15Z")

</div>

I get the confusion though, the docs sample clearly specifies `$` symbol in the replacement as simply part of the literal `$2000`. I guess it was just a hunch for me to try `\1`, `%1`, `$1` — I never remember which that is in this or that language.

---

<div class="post-metadata">

**Author:** ![Federico\_Stefanato](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/federico_stefanato/32/10092_2.png) [@Federico\_Stefanato](https://connect.superhuman.com/u/Federico_Stefanato)\
**Post date:** [January 20, 2020, 1:57pm UTC](https://connect.superhuman.com/t/split-wont-split/13351/11 "2020-01-20T13:57:09Z")

</div>

Exactly: I just read the formula specs and simply interpolated my understanding from that.

@Codans: Maybe update the example with @Paul_Danyliuk’s one would help to better see the potential.
