You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is automatically rewritten to a class constructor or a static function invocation that has a matching attribute:
[StringLiteral("r")]publicclassRegex{publicRegex(stringpattern)//A constructor that can accept a single string argument is required.{ ...}[StringLiteral("ri")][EditorBrowsable(EditorBrowsableState.Never)]publicstatic Regex CreateIgnoreCase(stringpattern){ ...}}
If there are two StringLiteral attributes with the same parameter in scope, it is a compilation error.
Potential use cases: simplifying the syntax for regexes, constant byte arrays or UTF-8 encoded strings. If compile-time metaprogramming is ever implemented in C#, the same syntax can be reused for safe XML literals, like in VB.
The text was updated successfully, but these errors were encountered:
A string literal or a raw string literal can be prepended by an identifier:
This is automatically rewritten to a class constructor or a static function invocation that has a matching attribute:
If there are two
StringLiteral
attributes with the same parameter in scope, it is a compilation error.Potential use cases: simplifying the syntax for regexes, constant byte arrays or UTF-8 encoded strings. If compile-time metaprogramming is ever implemented in C#, the same syntax can be reused for safe XML literals, like in VB.
The text was updated successfully, but these errors were encountered: