Skip to content

A way to write ustring literally using a FormattableString #31

Description

@ebekker

Wonder if there is any interest in being able to write a literal ustring that may contain embedded non-UTF16 friendly bytes? I was thinking that if you provide a parser for a FormattableString, you can use some Format Item format code to intermix literal character strings with raw bytes.

Something like:

var us = ustring.Make($"Sample {0xff::} Embedded");

This would yield a ustring (us) with the content:

Char Byte
'S' 83
'a' 97
'm' 109
'p' 112
'l' 108
'e' 101
' ' 32
ff 255
' ' 32
'E' 69
'm' 109
'b' 98
'e' 101
'd' 100
'd' 100
'e' 101
'd' 100

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions