GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Modul 11 von 15 · Medien

Working with Strings

Kostas Diakogiannis

Working with Strings

Working with strings

 

Strings are a different data type. Strings is a series of symbols added together. These symbols can be anything, letters, special  characters and even numbers. A string is initiated by being inside quotes (' ').

It doesn't matter if they are single or double quotes, as long as you stick to the rule that you use as a closing quote, the same type that you used as an opening quote. Whatever lies inside the quotes will be printed exactly as it is. #what_you_see_is_what_you_get

 

Print 5 strings as they are to the console.

Then print strings that represent a math operation inside the quotes? What can you tell? Do you see the result of the operation or the string itself?

 

Attention! Try the string concatenation '+' operator. Is there any difference when working with numbers and when working with strings? Why?

Print 3 times an addition between:

1) A number and a number

2) A String and a number

3) A string and a string

 

What are the results?

Anleitung

Um im Kurs weiterzukommen, sende einen Versuch dieses Quiz ab. Du kannst ihn nach der letzten Frage absenden.

Zum gewählten Modul

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck