The limit depends only on the amount of memory available.
so on my windows 2003 64 bit with 1.2 gb of memory and 15 Gb of free
harddisk space on the disk that contains the swapfile it might be a different
amount as on yours :-)
Michel Posseth [MCP]
"Qwert" wrote:
[color=blue]
> Hello,
>
> is there a max length for a System.String?
>
> Thanks.
>
>
>[/color]
"Herfried K. Wagner [MVP]" wrote:
[color=blue]
> "Qwert" <nosp@nosp.co m> schrieb:[color=green]
> > is there a max length for a System.String?[/color]
>
> I guess it is ~ 'Int32.MaxValue ', because otherwise properties and methods
> of the 'String' class would not work as expected any more.
>
> --
> M S Herfried K. Wagner
> M V P <URL:http://dotnet.mvps.org/>
> V B <URL:http://classicvb.org/petition/>
>
>[/color]
Answers is the place to go to get the answers you need and to ask the questions you want
wich states that the memory should be the limit
interesting :-)
regards
Michel Posseth [MCP]
"Herfried K. Wagner [MVP]" wrote:
[color=blue]
> "Qwert" <nosp@nosp.co m> schrieb:[color=green]
> > is there a max length for a System.String?[/color]
>
> I guess it is ~ 'Int32.MaxValue ', because otherwise properties and methods
> of the 'String' class would not work as expected any more.
>
> --
> M S Herfried K. Wagner
> M V P <URL:http://dotnet.mvps.org/>
> V B <URL:http://classicvb.org/petition/>
>
>[/color]
I tried to create a string with 2.147.483.647 characters, but around
50.000.000 characters my system can't handle it anymore. That's only 2% of
it...
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> schreef in bericht
news:eDAFXP54FH A.3192@TK2MSFTN GP12.phx.gbl...[color=blue]
> "Qwert" <nosp@nosp.co m> schrieb:[color=green]
>> is there a max length for a System.String?[/color]
>
> I guess it is ~ 'Int32.MaxValue ', because otherwise properties and methods
> of the 'String' class would not work as expected any more.
>
> --
> M S Herfried K. Wagner
> M V P <URL:http://dotnet.mvps.org/>
> V B <URL:http://classicvb.org/petition/>[/color]
well just as curious as i am i tried when my system couldn`t handle it
annymore
Acer 1524 WLMI Laptop ( Desktop replacement )
AMD 64 3400 +
Windows Server 2003 X64
1,2 GB of memory
running in visual studio 2003
this is still running
Dim s As New String("a", 490000000)
500000000 will raise an error ( out of memorry )
490.000.000 that is pretty much more as you :-)
now in Visula studio 2005 in x64 mode
this is still running
Dim s As New String("a", 1000000000)
however this raises the out of memory exception 1100000000
Looking at my taskmanager i saw hughe memory consumption VM size of 2 GB
physical memory of 980 MB
verry interesting as this proves to me that the maxsize of a string is
limited by
a : hardware
b : platform
C : max size of the integer data type
it is for sure that you can not ever create a string that is bigger as the
integer`s maximum size of the data type
however how the Hardware and platform relate to the maximum creatable size
is unknown to me , ,,,,,,,,,, interesting
regards
Michel Posseth
"Qwert" wrote:
[color=blue]
> Great, thanks both.
>
> I tried to create a string with 2.147.483.647 characters, but around
> 50.000.000 characters my system can't handle it anymore. That's only 2% of
> it...
>
>
>
> "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> schreef in bericht
> news:eDAFXP54FH A.3192@TK2MSFTN GP12.phx.gbl...[color=green]
> > "Qwert" <nosp@nosp.co m> schrieb:[color=darkred]
> >> is there a max length for a System.String?[/color]
> >
> > I guess it is ~ 'Int32.MaxValue ', because otherwise properties and methods
> > of the 'String' class would not work as expected any more.
> >
> > --
> > M S Herfried K. Wagner
> > M V P <URL:http://dotnet.mvps.org/>
> > V B <URL:http://classicvb.org/petition/>[/color]
>
>
>[/color]
Comment