Skip to content

Commit

Permalink
Using culture invariant versions of TpUpper and ToLower while geneart…
Browse files Browse the repository at this point in the history
…ing operation names (#2594)

eg: If  regional settings format is Turkish, the classical 'i' character problem occurs.
  • Loading branch information
ud09 authored and RicoSuter committed Dec 26, 2019
1 parent ba02ffc commit 3e789a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ internal static string CapitalizeFirst(string name)
return string.Empty;
}

var capitalized = name.ToLower();
return char.ToUpper(capitalized[0]) + (capitalized.Length > 1 ? capitalized.Substring(1) : "");
var capitalized = name.ToLowerInvariant();
return char.ToUpperInvariant(capitalized[0]) + (capitalized.Length > 1 ? capitalized.Substring(1) : "");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ internal static string CapitalizeFirst(string name)
return string.Empty;
}

var capitalized = name.ToLower();
return char.ToUpper(capitalized[0]) + (capitalized.Length > 1 ? capitalized.Substring(1) : "");
var capitalized = name.ToLowerInvariant();
return char.ToUpperInvariant(capitalized[0]) + (capitalized.Length > 1 ? capitalized.Substring(1) : "");
}
}
}

0 comments on commit 3e789a9

Please sign in to comment.