Results for “dot”
Small, practical examples. Search by task or narrow things down below.
Quote a literal search term for a regex
C#: Regex.Escape prevents metacharacters in a literal term from changing the pattern.
C#✓ Tested
Read a big-endian binary integer
C#: Use BinaryPrimitives when the protocol byte order differs from or must not depend on the host.
C#✓ Tested
Read a filename stem and extension
C#: Use Path helpers instead of splitting a path on dots or directory separators.
C#✓ Tested
Read a JSON property
Parse a JSON document and dispose it after reading in C#.
C#✓ Tested
Read a text file
Load a small text file into a C# string.
C#✓ Tested
Read an optional JSON property safely
C#: Use TryGetProperty instead of throwing when an optional property is absent.
C#✓ Tested
Read one character from ASCII text
C#: Use a valid zero-based index to read the first character.
C#✓ Tested
Read the beginning of a text value
C#: Extract or display the first three ASCII characters from a known nonempty string.
C#✓ Tested
Read the first collection element
C#: Access index zero only after establishing that the collection is nonempty.
C#✓ Tested
Reject infinity and NaN
C#: Double.IsFinite distinguishes usable finite numeric inputs from special values.
C#✓ Tested
Remove duplicate records by a selected key
C#: DistinctBy keeps the first record for each key in encounter order.
C#✓ Tested
Remove duplicate values
Use LINQ Distinct and OrderBy for a sorted C# result.
C#✓ Tested