Re: Slice/Substr [0..?lastIndexOf(".")] How refer itself without create a variable?

2019-12-05 Thread Bastiaan Veelo via Digitalmars-d-learn
On Thursday, 5 December 2019 at 11:28:51 UTC, Marcone wrote: Simple example: writeln("Hi\nHow are you?\nGood".splitLines()[0][0..?lastIndexOf(r"\")]); How to refer to this string in lastIndexOf() without create a variable? Thank you. .splitLines[0] already just produces "Hi", containing

Re: Slice/Substr [0..?lastIndexOf(".")] How refer itself without create a variable?

2019-12-05 Thread Andrea Fontana via Digitalmars-d-learn
On Thursday, 5 December 2019 at 11:28:51 UTC, Marcone wrote: Simple example: writeln("Hi\nHow are you?\nGood".splitLines()[0][0..?lastIndexOf(r"\")]); How to refer to this string in lastIndexOf() without create a variable? Thank you. One solution: writeln( "Hello\nHow are yo

Slice/Substr [0..?lastIndexOf(".")] How refer itself without create a variable?

2019-12-05 Thread Marcone via Digitalmars-d-learn
Simple example: writeln("Hi\nHow are you?\nGood".splitLines()[0][0..?lastIndexOf(r"\")]); How to refer to this string in lastIndexOf() without create a variable? Thank you.