Why one cant concatenate? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why one cant concatenate?

like ," AWAL is' + 20 'years"

25th Nov 2017, 2:50 PM
Mohammed AWAL
Mohammed AWAL - avatar
3 Answers
+ 1
Make your question more specific and clear; mention the programing language including, if possible, your attempt and desired outcome.
25th Nov 2017, 3:05 PM
dunfc
dunfc - avatar
+ 1
If " AWAL is' + 20 'years" is your attempt, you aren't doing it right. Strings need to start and end with the same quote so that is a single string. "this"+" is "+"three strings" The above is three strings concatenated together. You can replace one or more strings with variables, but you might need to force concatenation versus addition if you want to use a number first.
25th Nov 2017, 3:40 PM
John Wells
John Wells - avatar
+ 1
your string starts with a double quote and ends in a double quote and reverse for the second.attempting to do this should in logic throw a fatal error
25th Nov 2017, 3:59 PM
᠌᠌Brains[Abidemi]
᠌᠌Brains[Abidemi] - avatar