I am getting a variable that holds a string. I want to trim it to first "?" sign, so I can pass it futher.
For example, I want to always transfrom x = /example?idontwantthis
to x = /example?
I’d go with String.split/3
"/example?idontwantthis" |> String.split("?") |> hd()
#⇒ "/example"