10:30:11 on April 6, 2015 from blog. hazard. kr
1。==
and !=
operator
Net
Net has the same value of the comparison value of the ==
overload 字符串等于
.
Java
Java is 串
slick, and due to its nature, the referrer is the same, the same, the same and the same is impossible.
Developers 字符串等于
use it for developers .
2。 + operator
Net:
串s=“asd”+b+“qwe”; //>>串s=串。康卡特(“asd”,b,“ qwe”);
串 。cs
。NETconcat Principle
[System。安全。安全性安全关键] //自动生成上市 静态的 串 Concat(串 str0, 串 str1) {// 合同는Test및유효성사검스를스클래스임。合同。确保(合同.结果<串>() != 空值);合同.确保(合同.结果</string><string>().长度 ==(str0 == 空值 ? 0 : str0.长度) +(str1 == 空值 ? 0 : str1.长度));Contract.EndContractBlock();如果 (IsNullOr空的(str0)) {如果 (IsNullOrEmpty(str1)) {返回 串.Empty;}返回 str1;}如果 (IsNullOrEmpty(str1)) {返回 str0;}整型 str0长度 = str0.长度;//.NET네이티브를가다가포인터에이를자리자리자串 结果 = FastAllocateString(str0Length + str1.Length);//그리고다가순서대로삽입FillStringChecked(结果, 0,str0);FillStringChecked(结果, str0Length, str1);//그리하여포인터。返回 结果;}
Java:
String s = "asd" + b + "qwe";
//>> String s = new StringBuffer().append("asd").append(b).append("qwe").toString();
StringBuffer.java
Java has a StringBuffer
difference in principle that it has a string increment operator promise .
Merging String Advantages
插图: length by rimankeum reulreul mmm eumeumeum results Results gapeum eumeumeum eumeumeum eumeumeum
Java: StringBuffer
need need need need to cut output reulreul Problem huhuhu Well eumeumeum eumeumeum eumeumeum eumeumeum eumeumeum eumeumeum eumeumeum eumeumeum eumeumeum (default +16)
Consensus consensus
When adding a string in a loop, etc., the net StringBuilder
and the Java are StringBuffer
profitable.
So far.
from: https://dev.to//composite/-596p