[每日高赞翻译stackoverflow](1)string 和 String 的区别
来源:互联网 发布:淘宝cpu散片哪家靠谱 编辑:程序博客网 时间:2024/05/17 06:18
本人翻译水平不怎么样,如果有错误请各位大大提出来
来源:https://stackoverflow.com/questions/7074/what-is-the-difference-between-string-and-string-in-c
如果你认同他的看法或者有所帮助,可以到网站为他点个赞
string
is an alias in C# for System.String
. So technically, there is no difference. It's like int
vs. System.Int32
.
string 类型是System.String的别名。所以从技术上来讲,他们没有区别。就像 int 和 System.Int32
As far as guidelines, I think it's generally recommended to use string
any time you're referring to an object.
仅仅作为引导,我推荐 与对象有关的时候用string。
e.g.
string place = "world";
Likewise, I think it's generally recommended to use String
if you need to refer specifically to the class.
像这样,我推荐 与类有关的时候用String
e.g.
string greet = String.Format("Hello {0}!", place);
This is the style that Microsoft tends to use in their examples.
这也是微软倾向使用的风格
It appears that the guidance in this area may have changed, as StyleCop now enforces the use of the C# specific aliases.
stylecop现在实施这种c#具体的别名的用法,表现出这种引导可能随时会改变
-----------------------------------------------------
译者总结:
两个没区别
- [每日高赞翻译stackoverflow](1)string 和 String 的区别
- String和string的区别
- String和string的区别
- String和string的区别
- string和String的区别
- String和string的区别
- String和string的区别
- string[][]和string[,]的区别
- String和string的区别
- String和string的区别以及string的区别
- String和string区别
- String...和String[]区别
- String详解, String和CharSequence区别, StringBuilder和StringBuffer的区别 (String系列之1)
- String详解, String和CharSequence区别, StringBuilder和StringBuffer的区别 (String系列之1)
- String详解, String和CharSequence区别, StringBuilder和StringBuffer的区别 (String系列之1)
- String详解, String和CharSequence区别, StringBuilder和StringBuffer的区别 (String系列之1)
- String详解, String和CharSequence区别, StringBuilder和StringBuffer的区别 (String系列之1)
- String详解, String和CharSequence区别, StringBuilder和StringBuffer的区别 (String系列之1)
- 【codevs 3185】队列练习1
- cordova-plugin-crosswalk-webview 安装出现错误
- 调试QWebView中javascript代码的方法
- Scala-数组的使用
- python下setuptools安装
- [每日高赞翻译stackoverflow](1)string 和 String 的区别
- Linux下的软件Mysql完全卸载(包括其依赖和库等残留文件)
- Hibernate懒加载异常: org.hibernate.LazyInitializationException: could not initialize proxy
- 软件测试分类
- 性能测试:响应时间/并发用户数/吞吐量/思考时间的计算
- jdbcTemplate常见用法整理。
- 上线打包出现错误整理90362,90535,4238
- 使用jsencrypt实现参数的前端加密
- VirtualBox for mac调整虚拟机硬盘大小