Learn free solidity tutorials

How to append the string to another in solidity| Solidity by example

December 1, 2022 ·  1 min read

This tutorial talks about how to do string concatenation in solidity. This explains how to append one string to another string in solidity. For example, you have two strings. string str = 'hello' string b = "world" And output is hello world It is very easy to append strings in another programming language such as java and javascript using the + or append function or method. There is no inbuilt support for append function or + operator in solidity strings....

How to check value or object exists in Solidity mapping?

December 1, 2022 ·  3 min read

This tutorial explains how to check object that exists in Solidity mapping. mapping in java is a similar to hash table in solidity. It stores keys and values, each key holds value types(primitive types) and value types are reference types(struct, nested mapping, array objects). Every key is mapped to value in a solidity. If the value does not exist, means the value is zero. There are null or undefined or empty object concepts in solidity....

How to convert string to array in Solidity? Solidity by example?

December 1, 2022 ·  2 min read

This tutorial talks about how to convert a string of text into an array using a string separator. The string is a valid value type in Solidity stores text content. Array in solidity is a reference type that contains a group of data types stored under a single name variable. the values are retrieved using an index starting from zero. There is no inbuilt function to convert string to array in solidity....

How to find the length of a string in solidity| Solidity by Example

December 1, 2022 ·  1 min read

This tutorial finds the string length in solidity with examples. It checks the number of characters in a given string and returns the length of a string. For example, given the string is hello, the output is 5. In solidity, the string is a group of characters stored inside an array and stores the data in bytes. There is no length method in string type. How to find string length in solidity First, convert string to bytes using the bytes(string) method....

How to get an ABI json file from a given contract code and address in Solidity?

December 1, 2022 ·  2 min read

This tutorial shows ways to generate an Application Binary Interface json file for a given contract source code. Application Binary Interface is an interface that contains functions and arguments of a contract in JSON format. It is used to encode and decode data to and from blockchain transactions. Generate ABI json file using local solc compiler If the solidity compiler is installed local machine and solc command is working, then type the below command to get the Abi file....

How to get array length in a solidity| Solidity by example

December 1, 2022 ·  1 min read

The array is a fixed or dynamic compile time in solidity. Sometimes, We want to find the array length to check several elements in Solidity. Solidity Array provides a length property to return the number of array elements in it. How to find the length of an array in solidity First, Array is created by initializing static data. Next, create a size() public function which returns the count of elements in an array....

You'll get a notification every time a post gets published here.