What are strings?

356 views

There is a recent tweet in which a lady said 1+2=12.

Obviously that is wrong but everyone keeps saying “it’s wrong unless we are talking about strings”

What are strings?

Edit: thank you all for explaining:) have a cookie 🍪 and a wonderful day

In: 6

10 Answers

Anonymous 0 Comments

Answer: It is a programmer joke.

The actual tweet is made by a US Political candidate which isn’t relevant to the answer but is necessary for the backstory.

In computer programming, a ‘string’ is basically a sequence of characters. I can have a string called str and have its value be whatever I want. The technicalities will differ based on language but as a high level concept that is what it means.

That tweet 1+2=12 was shared on multiple forums, including r/ProgrammerHumor

The + sign can be used to combine two strings. Like “foo” + “bar” can equal “foobar”. Just like that 1+2 can become 12 if you were to look at it like combining two strings together.

You are viewing 1 out of 10 answers, click here to view all answers.