VB.NET: If I pass a String ByVal into a function but do not change the string, do I have one or two strings in memory? -
I know that the string is irreversible, so you change the value of a string reference. Creates a new string on the net pile.
But what if you does not change the value of the string context; Rather, you pass it only in the ByVal
function - does this copy the string value on the operation pile? My tilt is "no" but I want to confirm it.
For example:
Public Function IsStringHello (Bug Val Test String) In the form of bullion returns (string calling program: Boolean = IstringHello (myWord)
I know that value from myWord
reference to the string = "Blah" in the form of a slow myWord , but since I have not tried to change the string, is it the second copy of the string on the heap By the way, the string internation is completely unrelated to that of the standards for the tasks;
The rules are simple and you have told it correctly: Copy value from reference , target no. Is not.
Comments
Post a Comment