Q:

String.Substring explanation

In my program I have a long string sent via another program. This string is roughly 100 characters long and I only need a small portion of it. For this, we'll say the string I'm sending is as follows:

Hello, I am a test string. I am awfully long and full of things you don't want. 

So, to cut the string so I only get the portion I need I have used the following string method:
String.Substring(startPoint, Endpoint)

Now in my program I know that the bit of the string I need to use is exactly 38 characters from the start and is only 36 characters long. Thus my call looks something like this:
 String.Substring(38, 36)

And my program will happily read in test string from the above example. 
This doesnt show up any issues or bugs when I build the program. But when I run it, the computer complains that the end point can't be lower than the start point. The thing is, however, the part of the message I want, gets sent over. 
I've tried modifying my call so that it would look similar to this:
String.Substring(startPoint, startPoint + 36)

But that has returned a bunch of extra characters I don't need or want. 
Now my thinking behind that method is that it works by taking my initial point, the 38th character from the beginning of the string, and then goes 36 characters along from the 38th. Is my thinking behind how this method works wrong?
Why does this computer complain about an issue but then does what I want anyway?

A:

You keep saying "endpoint", but it's string length.  You're right in the way it's supposed to work.  I'm not sure why you're getting a warning.  Here is the information on the method.
http://msdn.microsoft.com/en-us/library/system.string.substring.aspx
Is the warning coming from a plugin?

