-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Fixed list formatting #2580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed list formatting #2580
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but there are some things to fix before merging
[!code-vb[System.ArgumentOutOfRangeException#5](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/vb/NoElements.vb#5)] | ||
- You are retrieving the member of a collection by its index number, and the index number is invalid. | ||
|
||
This is the most common cause of an <xref:System.ArgumentOutOfRangeException> exception. Typically, the index number is invalid for one of three reasons: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We say there are three reasons but we have four bullets. Also, should we use numbered list for these reasons?
|
||
[!code-csharp[System.ArgumentOutOfRangeException#18](~/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/NoFind2.cs#18)] | ||
[!code-vb[System.ArgumentOutOfRangeException#18](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/vb/NoFind2.vb#18)] | ||
The following example extracts the second word of a two-word phrase. It throws an <xref:System.ArgumentOutOfRangeException> exception if the phrase consists of only one word, and therefore does not contain an embedded space character. This occurs because the call to the <xref:System.String.IndexOf%28System.String%29?displayProperty=nameWithType> method returns -1 to indicate that the search failed, and this invalid value is then passed to the <xref:System.String.Substring%28System.Int32%29?displayProperty=nameWithType> method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
``` | ||
- You've attempted to extract a substring that is outside the range of the current string. | ||
|
||
The methods that extract substrings all require that you specify the starting position of the substring and, for substrings that do not continue to the end of the string, the number of characters in the substring. Note that this is not the *index* of the last character in the substring. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed list formatting
Fixes #2560
Related to #2552