educative.io

Educative

String quiz 4th question answer doubt

why question 4 answer is -brin.

String text="Please bring my coffee";System.out.println(text.substring(6,11));
it should be one space then brin not -brin. 


----
Type your question above this line.

Course: https://www.educative.io/collection/10370001/5138612588904448
Lesson: https://www.educative.io/collection/page/10370001/5138612588904448/5692985425526784

@rishabh_verma

Here - is indicating a space, if you look at the 2nd question it also has - (dashes) which are indicating spaces. And yes, your answer is correct that it should be one space and then brin but that one space here is a -.