Wycademy/src/Wycademy/WycademyExtensions.cs
/// <summary>
/// Converts a collection of strings to Discord IDs, ignoring any that are invalid.
/// </summary>
/// <param name="text">The collection to convert.</param>
/// <returns>A collection of IDs.</returns>
Converts a collection of strings to Discord IDs, ignoring any that are invalid.
Converts a collection of strings to Discord IDs ignoring any that are invalid .
public static IEnumerable<ulong> ParseIDs(this IEnumerable<string> text)
        {
            List<ulong> ids = new List<ulong>();
            foreach (string item in text)
            {
                ulong parsed;
                if (ulong.TryParse(item, out parsed))
                {
                    ids.Add(parsed);
                }
            }
            return ids;
        }
public static IEnumerable < ulong > ParseIDs ( this IEnumerable < string > text ) { List < ulong > ids = new List < ulong > ( ) ; foreach ( string item in text ) { ulong parsed ; if ( ulong . TryParse ( item , out parsed ) ) { ids . Add ( parsed ) ; } } return ids ; }
Converts a collection of strings to Discord IDs, ignoring any that are invalid.
Converts a collection of strings to Discord IDs ignoring any that are invalid .
A collection of IDs.
A collection of IDs .
IEnumerable<string>
this
text
The collection to convert.
The collection to convert .