C# alternative of Python shlex module?

Python's shlex.split is able to split strings with regards to quotes, even when quotes surround whitespaces

>>> import shlex
>>> shlex.split("a b   c 'd' ' ' g  h")
['a', 'b', 'c', 'd', ' ', 'g', 'h']

It can be seen that 1. Single quotes for d were removed 2. Whitespace surrounded by quotes (positioned after d) was preserved.

Is there anything for C# with such functionality?

If I use regular String.Split maximum I can get from it is to remove empty entries, but those two single quotes will qualify as separate entries.

Below is some simple code I wrote to illustrate it, which gives same output for above string.

var a = @"a b   c 'd' ' ' g  h";

List<string> ssplit(string st) {
    // Mimic python's shlex.split
    // in splitting a string by whitespaces
    // with respecting single quotes.
    var output = new List<string>();
    var within_quotes = false;
    var word_buf = new List<char>();
    foreach (char c in st) {
        if (c == '\'') {
            within_quotes = !within_quotes;
            continue;
        } else if (c == ' ') {
            if (!within_quotes) {
                if (word_buf.Count > 0) {
                    output.Add(new string(word_buf.ToArray()));
                    word_buf.Clear();
                };
                continue;
            };
        };
        word_buf.Add(c);
        };
        // Final check
        if (word_buf.Count > 0) {
            output.Add(new string(word_buf.ToArray()));
            word_buf.Clear();
        };
    return output;
}

Console.WriteLine(ssplit(a));