|
|
|
|
|
by neonsunset
788 days ago
|
|
C# has switch statements which are C/C++ style switches and switch expressions which are like Rust's match except no control flow statements inside: var len = slice switch
{
null => 0,
"Hello" or "World" => 1,
['@', ..var tags] => tags.Length,
['{', ..var body, '}'] => body.Length,
_ => slice.Length,
};
(it supports a lot more patterns but that wouldn't fit) |
|