There is a reputation as being faster string manipulating tool than combining stringbirders' strings. Whether or not it is true, I'm thinking about the results of stringbiller operations and the stars of their production.
A quick trip to the reflector reveals that StringBuilder.ToString () does not always return the copy, sometimes it returns an example of an internal string
Then I use some internal functions to manipulate internal strings. Stringbilder sb = new string builder (s); String newString = sb.ToString (); Sb.Append ("And Rum Bottle"); String newNewString = sb.ToString (); String S = "Yo Ho Ho";
Are new string and newer string examples or similar? I have tried to understand it through the reflector, and I just do not understand everything.
How about this code?
stringbilder sb = new StringBuilder ("foo \ n"); Stringreader sr = new string reader (SB toastring ()); String s = sr.ReadLine (); Sb.Append ("Bar \ n"); S = sr.ReadLine ();
Will the last statement return empty or "bar"? And if it gives one or the other, is it defined or undefined behavior? In other words, can I trust it?
The documentation is remarkably brief on this subject, and I am reluctant to rely on the behavior observed according to the specification.
outside of mscorlib, any instance of a system. The string is irreversible, duration
The stringbuilder stringbuilder internally manipulates some of the strings internally, but at the end of the day, it will not return any string for you and later change it in its own way that is visible for your code. .
Also, in the form of StringBuilder.ToString () gives the same example of a string or similar string, which is dependent on the implementation and you should not rely on this behavior.
Comments
Post a Comment