+ 2
What is Concatenation
5 Réponses
+ 8
Concatenation is when you put things together, so in Python for example, when you add strings together, you concatenate them:
x = "hello "
y = "world"
print(x + y)
output: hello world
This only works with strings and not with numbers, unless the number is a string
+ 6
concatenation:any language involves merging/combining strings. # python
>>print('red'+'yellow')
redyellow
+ 2
thanks
+ 2
Concatenation means combination of two or more string in a single string ...
in java use + operator for concatenate any string and also use concat () Inbuilt method of string class in java
//by using concat method
class Demo{
public static void main(String args[]){
String s1="Ganesh ";
String s2="Apune";
String s3=s1.concat(s2);
System.out.println(s3);//
}
}
//by using +
class Demo{
public static void main(String args[]){
String s1="Ganesh ";
String s2="Apune";
String s3=s1+s2;
System.out.println(s3);
}
}
output is same:-
Ganesh Apune
0
We can say that concatenation is merging of two strings, in which second string is placed at end of first string.