Definition: - String is a data type that Represents text; that is, a series of Unicode characters.
Thread Safety: - This type is safe for
multithreaded operations.
A string is a sequential collection of
Unicode characters, typically used to represent text, while a String is
a sequential collection of System.Char objects that represents a string. The value of the String is
the content of the sequential collection, and the value is immutable.
A String is called immutable because its value
cannot be modified once it has been created. Methods that appear to modify a String actually
return a new String containing the modification. If it is
necessary to modify the actual contents of a string-like object, use the System.Text.StringBuilder class.
A single Char usually
represents a single code point; that is, the numeric value of the Char equals
the code point. However, a code point might require more than one encoded
element.
An index is the position of a Char, not a Unicode character, in a String. An index is a zero-based, nonnegative number
starting from the first position in the string, which is index position zero.
Consecutive index values might not correspond to consecutive Unicode characters
because a Unicode character might be encoded as more than one Char.
Members of String perform
either an ordinal or linguistic operation on a String. An ordinal operation acts on the numeric value
of each Char object. A linguistic operation acts
on the value of the String taking into account culture-specific
casing, sorting, formatting, and parsing rules. Linguistic operations execute
in the context of an explicitly declared culture or the implicit current
culture.
Comments
Post a Comment