dotnet / dotnet/dotnet-api-docs
Simplification of code
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 3d 27m
- Merged PRs (30d)
- 49
Description
In the code example, .ToLookup(p => Convert.ToChar(p.Company.Substring(0, 1)) is an overkill when a simple code such as .ToLookup(p => p.Company[0] achieves same result given that String class supports char indexer to fetch the underlying value.
---
#### Document Details
⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*
* ID: bf6b73de-2f5d-ec35-a010-c54207af6164
* Version Independent ID: b7c784b6-0318-f929-bfaa-e9fcbbd519c4
* Content: [Enumerable.ToLookup Method (System.Linq)](https://docs.microsoft.com/en-us/dotnet/api/system.linq.enumerable.tolookup?view=netframework-4.7.2)
* Content Source: [xml/System.Linq/Enumerable.xml](https://github.com/dotnet/dotnet-api-docs/blob/master/xml/System.Linq/Enumerable.xml)
* Product: **dotnet-api**
* GitHub Login: @dotnet-bot
* Microsoft Alias: **dotnetcontent**
Contributor guide
Assessment
This issue has not been assessed yet.