We can store string variables in an array for cases where string holds a large amount of data (string holding a script). In this case we can clear the array and it will also free the memory occupied by the string data. But we should only use this wisely as it can lead to the code that is difficult to read. So here is an example.
string $data[5]; $data[1] = "scriptNodeName"; $data[0] = `scriptNode -q -bs $data[1]`; // Do processing here clear $data;
No comments:
Post a Comment