Open koszeggy opened 2 years ago
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
Tagging subscribers to this area: @dotnet/area-system-runtime See info in area-owners.md if you want to be subscribed.
Author: | koszeggy |
---|---|
Assignees: | - |
Labels: | `api-suggestion`, `area-System.Runtime`, `untriaged` |
Milestone: | - |
Background and motivation
In many aspects
Rune
is similar tochar
, it has also the same formatting features, still, it does not support parsing.As a workaround, one can use the following solution:
But unfortunately
TryGetRune
has no overloads forReadOnlySpan<char>
so the span version of the workaround should either use enumarator or some switch over the length of the span.An additional motivation would be to be include the
Rune
type into the set ofIParseable<TSelf>
typesAPI Proposal
API Usage
Risks
I don't see any. But to be really similar to
char
maybe aRuneConverter
could also be necessary to be able convert to and from string in already existing libraries (eg. XML/JSON serializers, etc.)