answersLogoWhite

0

A string, in its most fundamental representation, is simply an array of characters. The language may or may not allow its contents to be modified in place, but its length can never change (just like any other array), short of changing one of the middle characters to NUL to hide the later ones.

String buffers, on the other hand, use some technique under the hood to produce the appearance that a string is being lengthened or shortened. Perhaps a string is spliced and concatenated as necessary to produce derivative strings which then replace it within the object, or maybe an expandable list, such as a vector or a linked list, of characters are combined into a string as necessary. These are implementation details whose efficiencies are surely different, but they produce the same effect.

In higher-level languages, the syntax often suggests that a string's length is changing, but this is just a variation of the first technique above: When one string is concatenated to another or spliced, a new string is produced and returned as the expression's value and typically assigned to the same variable as the original. If these operations were to modify the internal representation, this would be a true string buffer; otherwise it is only a string with syntactic sugar.

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

What is the difference between a buffer and an indicator?

Distinguish between buffer and indicator


What is the difference among string and string buffer and string builder?

String is the immutable class that means the object f that class never be changed. String is the Sequence of character.


What are the difference between buffer stock and safety stock?

no difference


What is the difference between n and endl in c plus plus?

The \n escape sequence simply inserts a newline within a string. std:endl does the same but also flushes the write buffer.


What is difference between inverter and buffer?

if you connect Nmos and Pmos other way around then it act as buffer


Difference between character and string?

A string ends with a '\0' character,but character is not.


What is the difference between TAE buffer and TE buffer?

The main difference is in composition. In TE common Tris buffer is bring down to pH 8 with HCl and EDTA is involved but in TAE instead of Tris HCl in TE Tris-acetate buffer is used.


What is the difference between Basel II and Basel III?

There is a main difference between Basel II and Basel III. In Basel III, there is a 4.5% capital buffer to absorb shock. With Basel II, there is no capital buffer.


What is the difference between rope and string?

The difference between thread rope and string is that thread is more thicker than string and that string is more thinner than rope and thread is more thinner than rope there's your answer geese


Whats The difference between a 6 and 7 string guitar?

There is practically no difference. The 7-string guitar has one lower string that the 6-string does not. It is usually tuned to B(natural).


Is there a difference between leather and string when weaving?

yes


What is the difference between tbs buffer-tbst buffer and corresponding function of them?

Tween 20. In TBST you add 0.05-0.1/ Tween 20.