src/Inedo.UPack/UniversalPackageId.cs
/// <summary>
/// Returns a <see cref="UniversalPackageId"/> instance parsed from the specified string.
/// </summary>
/// <param name="s">String containing the text to parse.</param>
/// <returns>Parsed <see cref="UniversalPackageId"/> instance.</returns>
/// <exception cref="ArgumentNullException"><paramref name="s"/> is null or empty.</exception>
Returns a  instance parsed from the specified string.
Returns a instance parsed from the specified string .
public static UniversalPackageId Parse(string s)
        {
            if (string.IsNullOrEmpty(s))
                throw new ArgumentNullException(nameof(s));
            var parts = s.Split(new[] { ':' }, 2);
            if (parts.Length == 2)
                return new UniversalPackageId(parts[0], parts[1]);
            int i = s.LastIndexOf('/');
            if (i >= 0)
            {
                var group = s.Substring(0, i);
                var name = s.Substring(i + 1);
                return new UniversalPackageId(group, name);
            }
            return new UniversalPackageId(null, s);
        }
public static UniversalPackageId Parse ( string s ) { if ( string . IsNullOrEmpty ( s ) ) throw new ArgumentNullException ( nameof ( s ) ) ; var parts = s . Split ( new [ ] { ' ' } , 2 ) ; if ( parts . Length == 2 ) return new UniversalPackageId ( parts [ 0 ] , parts [ 1 ] ) ; int i = s . LastIndexOf ( ' ' ) ; if ( i >= 0 ) { var group = s . Substring ( 0 , i ) ; var name = s . Substring ( i + 1 ) ; return new UniversalPackageId ( group , name ) ; } return new UniversalPackageId ( null , s ) ; }
Returns a  instance parsed from the specified string.
Returns a instance parsed from the specified string .
None
None
s
string
String containing the text to parse.
String containing the text to parse .