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
"/example?idontwantthis" |> String.split("?") |> hd() #⇒ "/example"