unoplatform / Uno.Core

Uno.Core is a set of helpers and extension methods used to accelerate development.
Other
39 stars 12 forks source link

StringExtensions.Format doesnt properly unescape nested formatting #72

Open XiaotianNetlift opened 4 years ago

XiaotianNetlift commented 4 years ago

I'm submitting a...

Current behavior

The Uno.Extensions.StringExtensions.Format method doesn't properly unescape {{ o }} from nested formatting.

Expected behavior

Minimal reproduction of the problem with instructions

string.Format(CultureInfo.CurrentCulture, "{{0:0.00 {0};0.00 {0};FREE}}", "$").Dump();
Uno.Extensions.StringExtensions.Format(CultureInfo.CurrentCulture, "{{0:0.00 {0};0.00 {0};FREE}}", "$").Dump();
string.Format(CultureInfo.CurrentCulture, "{{0:0.00 {0}}}", "$").Dump();
Uno.Extensions.StringExtensions.Format(CultureInfo.CurrentCulture, "{{0:0.00 {0}}}", "$").Dump();

output:

{0:0.00 $;0.00 $;FREE}
{{0:0.00 $;0.00 $;FREE}}
{0:0.00 $}
{{0:0.00 $}

Environment

Nuget Package: Uno.Core Package Version(s): 2.0.0