Is Int32.ToString() culture-specific?

后端 未结 7 1082
名媛妹妹
名媛妹妹 2020-11-30 09:47

I\'m running a beta version of ReSharper, and it\'s giving me warnings for the following code:

int id;
// ...
DoSomethingWith(id.ToString());
7条回答
  •  心在旅途
    2020-11-30 10:00

    I would have said no, but on checking MSDN Int32.ToString() there's this:

    The return value is formatted with the general numeric format specifier ("G") and the NumberFormatInfo object for the current culture.

    So there's a surprise.

    The question should be why doesn't the current Resharper suggest this?

提交回复
热议问题