是否有理由在字符串/列表上使用.Contains而不是.IndexOf?我将使用.Contains编写的大多数代码在不久之后需要项目的索引,因此必须执行这两个语句.但为什么不在一个?
if ((index = blah.IndexOf(something) >= 0)
// i know that Contains is true and i also have the index
Run Code Online (Sandbox Code Playgroud) 在我的系统上:c ++中的sizeof(long)是4#又称32位sizeof(long)在c#中是8位64位
所以在我的Interop方法声明中,我一直用c#int代替c ++ longs但是我觉得这不安全吗?
为什么长度与c ++中的int相同?长期是64位?什么是下一个很长很长的??