String Concatenation - Solidity Typing CST Test
Loading…
String Concatenation — Solidity Code
Concatenates two strings and stores in a state variable.
pragma solidity ^0.8.0;
contract ConcatStrings {
string public str1 = 'HELLO';
string public str2 = 'WORLD';
string public result;
function concat() public {
result = string(abi.encodePacked(str1, str2));
}
}Solidity Language Guide
Solidity is a statically typed, contract-oriented programming language designed for building smart contracts on the Ethereum blockchain. It enables developers to write decentralized applications (dApps), manage digital assets, and automate trustless logic using a syntax inspired by JavaScript, C++, and Python.
Primary Use Cases
- ▸Smart contract development
- ▸DeFi protocols (DEXs, lending, staking)
- ▸NFT standards (ERC-721, ERC-1155)
- ▸Token creation (ERC-20)
- ▸DAO governance mechanisms
- ▸Permissioned enterprise blockchain apps
Notable Features
- ▸Contract-oriented design
- ▸Strong static typing
- ▸Events for EVM logs
- ▸Function modifiers
- ▸Library & inheritance support
Origin & Creator
Solidity was created by Gavin Wood and the Ethereum Foundation in 2014 to serve as the primary language for writing smart contracts on the Ethereum blockchain.
Industrial Note
Solidity is heavily used in decentralized finance (DeFi), NFT marketplaces, blockchain gaming, DAOs, tokenization engines, supply chain tracking, on-chain governance, and enterprise blockchain automation.