Forum Multiplayer Please allow us to use System.StringComparer if possible.

Discussion and help relating to the PlayerIO Multiplayer API.

Please allow us to use System.StringComparer if possible.

Postby Emalton » April 21st, 2018, 6:49 pm

We can't use handy things like System.StringComparer.OrdinalIgnoreCase, which really sucks!
Emalton
 
Posts: 86
Joined: June 28th, 2013, 3:49 am

Re: Please allow us to use System.StringComparer if possible

Postby Henrik » May 16th, 2018, 3:52 am

I've added it to the whitelist, it will get rolled out eventually.

In the meantime, if you for example want to sort a List<string>, instead of doing:

Code: Select all
list.Sort(StringComparer.OrdinalIgnoreCase);

You can do this:

Code: Select all
list.Sort((a, b) => String.Compare(a, b, StringComparison.OrdinalIgnoreCase));
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm


Return to Multiplayer



cron