String is a class or data type?
string is class or data type?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Gopi ChandRank #262 · 9.6K reputationPosted May 24, 2015, 12:22 PM EDT
So string is also a class. For more details, follow the link below:
Pankaj Kumar ChoudharyRank #80 · 24.4K reputationPosted May 24, 2015, 2:51 PM EDT
// Represents text as a series of Unicode characters.
[Serializable]
[ComVisible(true)]
public sealed class String : IComparable, ICloneable, IConvertible, IComparable
{
// Summary:
// Represents the empty string. This field is read-only.
public static readonly string Empty;
// Summary:
// Initializes a new instance of the System.String class to the value indicated
// by a specified pointer to an array of Unicode characters.
//
// Parameters:
// value:
// A pointer to a null-terminated array of Unicode characters.
//
// Exceptions:
// System.ArgumentOutOfRangeException:
// The current process does not have read access to all the addressed characters.
//
// System.ArgumentNullException:
// value is null.
//
// System.ArgumentException:
// value specifies an array that contains an invalid Unicode character, or value
// specifies an address less than 64000.
[CLSCompliant(false)]
[SecurityCritical]
public String(char* value);
//
// Summary:
// Initializes a new instance of the System.String class to the value indicated
// by an array of Unicode characters.
//
// Parameters:
// value:
// An array of Unicode characters.
[SecuritySafeCritical]
public String(char[] value);
//
// Summary:
// Initializes a new instance of the System.String class to the value indicated
// by a pointer to an array of 8-bit signed integers.
//
// Parameters:
// value:
// A pointer to a null-terminated array of 8-bit signed integers.
//
// Exceptions:
// System.ArgumentNullException:
// value is null.
//
// System.ArgumentException:
// A new instance of System.String could not be initialized using value, assuming
// value is encoded in ANSI.
//
// System.ArgumentOutOfRangeException:
// The length of the new string to initialize, which is determined by the null
// termination character of value, is too large to allocate.
//
// System.AccessViolationException:
// value specifies an invalid address.
[CLSCompliant(false)]
[SecurityCritical]
public String(sbyte* value);
//
// Summary:
// Initializes a new instance of the System.String class to the value indicated
// by a specified Unicode character repeated a specified number of times.
//
// Parameters:
// c:
// A Unicode character.
//
// count:
// The number of times c occurs.
//
// Exceptions:
// System.ArgumentOutOfRangeException:
// count is less than zero.
[SecuritySafeCritical]
public String(char c, int count);
//
// Summary:
// Initializes a new instance of the System.String class to the value indicated
// by a specified pointer to an array of Unicode characters, a starting character
// position within that array, and a length.
//
// Parameters:
// value:
// A pointer to an array of Unicode characters.
//
// startIndex:
// The starting position within value.
//
// length:
// The number of characters within value to use.
//
// Exceptions:
// System.ArgumentOutOfRangeException:
// startIndex or length is less than zero, value + startIndex cause a pointer
// overflow, or the current process does not have read access to all the addressed
// characters.
Nanhe SiddiqueRank #1,103 · 1.7K reputationPosted May 24, 2015, 8:04 PM EDT
Munesh SharmaRank #174 · 13.9K reputationPosted May 24, 2015, 8:55 PM EDT