How To Add Strings Together

[Solved] How To Add Strings Together | Solidity - Code Explorer | yomemimo.com
Question : adding strings together

Answered by : isaac-dtlde76ih65h

# concatenating strings just means combining strings together
# it is used to add one string to the end of another
# below are two exmaples of how concatenation can be used
# to output 'Hello World':
# example 1:
hello_world = "Hello" + " World"
print(hello_world)
>>> Hello World
# example 2:
hello = "Hello"
print(hello + " World")
>>> Hello World

Source : | Last Update : Mon, 06 Jun 22

Question : how add strings together

Answered by : forbiddenpancake

//Java
String firstName = "BarackObama";
String lastName = " Care";
//First way
System.out.println(firstName + lastName);
//Second way
String name = firstName + lastName;
System.out.println(name);
//Third way
System.out.println("BarackObama" + " Care");

Source : | Last Update : Thu, 21 May 20

Question : how do you combine 2 strings

Answered by : obedient-ocelot-5tkogtygmlyl

-By using (+) operator
-By using concatenate method (concat()). String strconcat3=strconcat2.concat(strconcat);
-By StringBuffer
-String strconcat= new StringBuilder().append("matt") .append("damon").toString();
-By StringBuilder
- String strconcat2= new StringBuffer() .append("matt").append("damon").toString();

Source : | Last Update : Thu, 21 Jan 21

Answers related to how to add strings together

Code Explorer Popular Question For Solidity