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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Munesh SharmaPosted May 25, 2015, 12:55 AM
Nanhe SiddiquePosted May 25, 2015, 12:04 AM
Pankaj Kumar ChoudharyPosted May 24, 2015, 6:51 PM
// 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.
Gopi ChandPosted May 24, 2015, 4:22 PM
So string is also a class. For more details, follow the link below: