Question · Blockchain and Web3 course · Module 6: Solidity Basics

String vs bytes

What is the difference between the 'string' type and the 'bytes' type in Solidity?

Answer options

  • string for UTF-8 text, bytes for raw data
  • They're identical
  • bytes is faster
  • string uses less gas

You can check the correct answer by solving this task in the CodeWorlds game.