Home

LINQPad 6.9.15 seems not using latest .NET Core 5.0 API

edited June 2020

For following code:

void Main()
{
    typeof(int).Assembly.Location.Dump();
    PrintGraphemes("🤷🏽♀️");
}

static void PrintGraphemes(string str)
{
    Console.WriteLine($"Printing graphemes of \"{str}\"...");
    int i = 0;

    TextElementEnumerator enumerator = StringInfo.GetTextElementEnumerator(str);
    while (enumerator.MoveNext())
    {
        Console.WriteLine($"Grapheme {++i}: \"{enumerator.Current}\"");
    }

    Console.WriteLine($"({i} grapheme(s) total.)");
    Console.WriteLine();
}

Latest Roslyn and .NET Core 5.0 preview was enabled in LINQPad settings:

Output from LINQPad 6.9.15 and Visual Studio 2019 is different:

Looks like it's not referenced to the latest change, please refer to this page:
https://docs.microsoft.com/en-us/dotnet/core/compatibility/3.1-5.0#stringinfo-and-textelementenumerator-are-now-uax29-compliant

Comments

Sign In or Register to comment.