I wonder where strings are stored in Solidity?
Especially, where are string literals, function arguments, and variables stored?
I recall, I've read that strings cannot be saved to memory, but is that right?
contract-developmentmemorysoliditystoragestring
I wonder where strings are stored in Solidity?
Especially, where are string literals, function arguments, and variables stored?
I recall, I've read that strings cannot be saved to memory, but is that right?
Best Answer
Strings can be stored in both Storage and Memory - it depends on the type of variable / usage - here's an example:
There's a great section in the Solidity documentation
And also a great answer from @eth about memory in Ethereum