delete-string - (strings)
Contents
Description
delete-string frees <string> variable previously allocated by a Golf statement.
Note that freeing memory is in most cases unnecessary as Golf will automatically do so at the end of each
request. You should have a good reason for using delete-string otherwise.
Golf keeps count of <string> references for process-scoped memory (see memory-handling), and such memory
will be deleted at the end of the request once reference count reaches zero.
For non-process-scoped memory, if <string> is referenced by other variables, then <string> may not be
deleted. Regardless of whether the memory referenced by <string> is actually deleted or not, <string>
becomes an empty string ("") after delete-string.
Examples
Allocate and free random string:
random-string to ran_str
...
delete-string ran_str
Free string allocated by write-string (consisting of 100 "Hello World"s):
write-string ws
start-loop repeat 100
@Hello World
end-loop
end-write-string
...
delete-string ws
Name
delete-string - (strings)
Purpose
Free string memory.
See Also
Strings
concatenate-stringscopy-stringcount-substringdelete-stringlower-stringnew-stringread-splitreplace-stringset-stringsplit-stringstring-lengthtrim-stringupper-stringwrite-string See all documentation
$DATE $VERSION GOLF(2gg)
Syntax
delete-string <string>
