On 11.01.21 16:45, Marcone via Digitalmars-d-learn wrote:
"Hello World"[0..?.indexOf("o")]
Does until [1] do the trick?
"Hello World".until("o") // => "Hell"
[1] https://dlang.org/library/std/algorithm/searching/until.html
oddp via Digitalmars-d-learn Mon, 11 Jan 2021 08:41:32 -0800
On 11.01.21 16:45, Marcone via Digitalmars-d-learn wrote:
"Hello World"[0..?.indexOf("o")]
Does until [1] do the trick?
"Hello World".until("o") // => "Hell"
[1] https://dlang.org/library/std/algorithm/searching/until.html