Skip to content

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

Merged
merged 7 commits into from
Jun 13, 2019
Merged

Fixed list formatting #2580

merged 7 commits into from
Jun 13, 2019

Conversation

rpetrusha
Copy link

Fixed list formatting

Fixes #2560

Related to #2552

@rpetrusha rpetrusha self-assigned this Jun 10, 2019
Copy link
Contributor

@mairaw mairaw left a 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:
Copy link
Contributor

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This indentation is broken:
image

```
- 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too:
image

@rpetrusha rpetrusha merged commit 2500b44 into dotnet:master Jun 13, 2019
@rpetrusha rpetrusha deleted the oor branch June 13, 2019 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix formatting of ArgumentOutOfRangeException
2 participants