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

Modul 17 von 33 · Medien

Alternatives and optionals

Kostas Diakogiannis

Alternatives and optionals

Alternatives and optionals

With a ? question mark, we can specify that a part of the string is optional and could be additionally accepted if there, but not mandatory. 

The main difference between optionals and alternatives is that optionals mean, that either this character will be put or nothing, alternatives in contrast mean either the one, or the other one. But in the end for sure something. Nothing is not an option.

If we don't want to have partial match we can specify that the string that we are testing on should should begin and end with the pattern we have, and it is not a subset of a bigger string. To specify that this is the beginning we do it with the ^ character, and the end with a $ dollar sign character.
 

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