Skip to content

Commit

Permalink
string literal for bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
xhliu committed Feb 19, 2022
1 parent cc83f1b commit 7af6f40
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/syntax.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,14 @@ Basic Types
int a3 = 55066263022277343669578718895168534326250603453777594175500187360389116729240;
int a4 = 0xFF8C;
* **bytes** - a variable length array of bytes, whose literals are in quoted hexadecimal format prefixed by ``b``.
* **bytes** - a variable length array of bytes, whose literals are either in quoted hexadecimal format prefixed by ``b``, or double quoted UTB8 string.

.. code-block:: solidity
bytes b1 = b'ffee1234';
bytes b2 = b'414136d08c5ed2bf3ba048afe6dcaebafeffffffffffffffffffffffffffffff00';
bytes b3 = b'1122' + b'eeff'; // b3 is b'1122eeff'
bytes str = "hello world"; // utf8 string
Array Types
-----------
Expand Down

0 comments on commit 7af6f40

Please sign in to comment.