Less of an answer... more of a confirmation that crazy stuff is happening on your machine.
I got a longString
by using the "!gAS15169" query on http://radb.net/query/.
I tried initializing the longString
variable in a brand new C# project in VS2013 and it seemed to build and run just fine.
public class Program
{
public static void Main(string[] args)
{
string longString = "66.249.64.0/20 ***";
string greeting = "Hello World!";
Console.WriteLine(greeting + " " + longString);
Console.WriteLine("longString.Length = " + longString.Length);
}
}
*** I couldn't include the entire string in this answer because SO has a limit of 30K characters in a post.
The output of the Length
line is:
longString.Length = 74363
This isn't as long as you described in the question though, you said you had a string
that was 10K characters. Either way, it shouldn't matter because the maximum length for a string
in .NET (VB or C#) is just over 2 billion characters.
Also, I am running this on a 64bit PC and the C# project was set to build for "Any CPU".
I don't know why it isn't working for you but it should.