Skip to content

Commit

Permalink
Don't trim TimeZone names ending in parenthesys.
Browse files Browse the repository at this point in the history
Such as "Central Standard Time (Mexico)"

(cherry picked from commit 33332da)
  • Loading branch information
aespinosa-lj authored and akoeplinger committed Mar 1, 2016
1 parent 3f5bd28 commit 3c7a020
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mcs/class/corlib/System/TimeZoneInfo.cs
Expand Up @@ -288,7 +288,8 @@ private static string TrimSpecial (string str)
var Istart = 0;
while (Istart < str.Length && !char.IsLetterOrDigit(str[Istart])) Istart++;
var Iend = str.Length - 1;
while (Iend > Istart && !char.IsLetterOrDigit(str[Iend])) Iend--;
while (Iend > Istart && !char.IsLetterOrDigit(str[Iend]) && str[Iend] != ')') // zone name can include parentheses like "Central Standard Time (Mexico)"
Iend--;

return str.Substring (Istart, Iend-Istart+1);
}
Expand Down

0 comments on commit 3c7a020

Please sign in to comment.