Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is the source code for System.String for .Net Core?

Tags:

.net

.net-core

The String class for older versions should be at http://referencesource.microsoft.com/#mscorlib/system/string.cs. Where can I find the class for .Net Core. And also where can I find StringNative.cpp which is a base for this?

like image 271
Artyom Avatar asked May 14 '16 12:05

Artyom


People also ask

Where are strings stored C#?

Both the string and the char[] are stored on the heap - so storage is the same. Internally I would assume a string simply is a cover for char[] with lots of extra code to make it useful for you.

What is System string in C#?

A string is a sequential collection of characters that's used to represent text. A String object is a sequential collection of System. Char objects that represent a string; a System. Char object corresponds to a UTF-16 code unit. The value of the String object is the content of the sequential collection of System.

Which is the base class for string () method in C#?

The String class is defined in the . NET base class library. In other words, a String object is a sequential collection of System. Char objects which represent a string.

What is string in dotnet?

In C#, string is a sequence of Unicode characters or array of characters. The range of Unicode characters will be U+0000 to U+FFFF. The array of characters is also termed as the text. So the string is the representation of the text.


1 Answers

All the .NET Core source code is on Github, broken into corefx for the BCL beyond the bits that the CLR really depends on and coreclr for the CLR and the core parts of the BCL (like string).

stringnative.cpp is the native part of the CoreCLR string implementation, and String.cs contains the managed code.

like image 161
Jon Skeet Avatar answered Nov 23 '22 05:11

Jon Skeet