Say I have the string
public static string foo = "foo";
can I just do
foo = null;
in order to dereference that string?
Say I have the stringThat depends what you mean by dereference. If you want to clear the value, sure set to null like that would work. If you mean remove the variable from memory, static values are tied to the class, you'd have to unload the class.
public static string foo = "foo";
can I just do
foo = null;
in order to dereference that string?
On Thursday, November 3, 2022 at 1:05:17 PM UTC-4, C.D. Altenburg, Ph.D, wrote:Note that:
Say I have the string
public static string foo = "foo";
can I just do
foo = null;
in order to dereference that string?
That depends what you mean by dereference. If you want to clear the
value, sure set to null like that would work. If you mean remove the
variable from memory, static values are tied to the class, you'd have
to unload the class.
Say I have the string
public static string foo = "foo";
can I just do
foo = null;
in order to dereference that string?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 300 |
Nodes: | 16 (2 / 14) |
Uptime: | 73:02:03 |
Calls: | 6,714 |
Calls today: | 2 |
Files: | 12,246 |
Messages: | 5,357,085 |