+ 1

Which operator is used to concatenate two strings ??

2nd May 2018, 5:45 PM
gowri
gowri - avatar
6 Answers
+ 2
python: str1, str2 = 'string1' , 'string2' string = str1 + str2 print (string) string = ''.join([str1, str2]) print (string) the join method is more (memory) efficient if you concatenate large number of strings.
3rd May 2018, 10:16 AM
tamaslud
tamaslud - avatar
+ 6
python: "+" java: "+" php: "." c: "+" might be other methods
2nd May 2018, 6:08 PM
᠌᠌Code X
᠌᠌Code X - avatar
+ 2
The add operator in most languages e.g. "one " + "two"
2nd May 2018, 6:02 PM
TurtleShell
TurtleShell - avatar
2nd May 2018, 6:16 PM
Viryl15
Viryl15 - avatar
+ 1
In Python better use .format(): str3 = '{} {}'.format(str1, str2)
2nd May 2018, 9:01 PM
Sebastian Keßler
Sebastian Keßler - avatar
+ 1
Many ways lead to Rome.
3rd May 2018, 10:53 AM
Sebastian Keßler
Sebastian Keßler - avatar