Hello guys, I have a simple question. It's basically related to programming but never mind, I'm interested in how we subtract things.
Consider the following:
string message = "Find what is (inside the parentheses)";
int openingPosition = message.IndexOf('(');
int closingPosition = message.IndexOf(')');
int length = closingPosition - openingPosition;
Console.WriteLine(message.Substring(openingPosition, length));
Here, why length doesn't have the closing parentheses index included?
Is it the same thing when we do for e.g 7 - 4 ? Is there a difference when we say "subtract 2 numbers" and "interval between 2 numbers" ?