Solidity String Declaration – Inside Function Guidelines

soliditystring

I tried to declare string inside my function but it doesn't work.

How to declare string inside function?

enter image description here

Best Answer

I suspect it has to do with some already answered question like Why do Solidity examples use bytes32 type instead of string?

However, a code like the one below seems to work around without declaring a string.

contract A{
        function f() constant returns(string){
            var s="hello";
            return s;
        }

    }
Related Topic