| | | 1 | | // ----------------------------------------------------------------------- |
| | | 2 | | // <copyright file="CharHelper.cs" company="Stéphane ANDRE"> |
| | | 3 | | // Copyright (c) Stéphane ANDRE. All rights reserved. |
| | | 4 | | // </copyright> |
| | | 5 | | // ----------------------------------------------------------------------- |
| | | 6 | | |
| | | 7 | | using System; |
| | | 8 | | |
| | | 9 | | namespace MyNet.Primitives.Helpers; |
| | | 10 | | |
| | | 11 | | /// <summary> |
| | | 12 | | /// Provides helper methods and properties for working with characters. |
| | | 13 | | /// </summary> |
| | | 14 | | public static class CharHelper |
| | | 15 | | { |
| | | 16 | | /// <summary> |
| | | 17 | | /// Gets the alphabet as a read-only span of characters. |
| | | 18 | | /// </summary> |
| | | 19 | | /// <returns>A read-only span of characters representing the alphabet.</returns> |
| | 9 | 20 | | public static ReadOnlySpan<char> Alphabet => "abcdefghijklmnopqrstuvwxyz"; |
| | | 21 | | |
| | | 22 | | /// <summary> |
| | | 23 | | /// Gets the numbers as a read-only span of characters. |
| | | 24 | | /// </summary> |
| | | 25 | | /// <returns>A read-only span of characters representing the numbers.</returns> |
| | 6 | 26 | | public static ReadOnlySpan<char> Numbers => "0123456789"; |
| | | 27 | | |
| | | 28 | | /// <summary> |
| | | 29 | | /// Gets the numbers as a read-only span of characters. |
| | | 30 | | /// </summary> |
| | | 31 | | /// <returns>A read-only span of characters representing the hexadecimal digits.</returns> |
| | 3 | 32 | | public static ReadOnlySpan<char> HexDigits => "0123456789ABCDEF"; |
| | | 33 | | |
| | | 34 | | /// <summary> |
| | | 35 | | /// Gets the alphabet and numbers as a read-only span of characters. |
| | | 36 | | /// </summary> |
| | | 37 | | /// <returns>A read-only span of characters representing the alphabet and numbers.</returns> |
| | 3 | 38 | | public static ReadOnlySpan<char> AlphaNumbers => "abcdefghijklmnopqrstuvwxyz0123456789"; |
| | | 39 | | } |
| | | 40 | | |