Click here to navigate the course.

Drag the edges to resize the window.

In Projects, you can keep track of your progress as you go throught the tasks. Check each item as you complete it!

Code Editor
Thith Meanth War!

Setting Up the 'If' Branch, Part 1

All right! Time to add in a little control flow.

For the if half of our branch, we want to check whether the user's input contains an "s".

if string_to_check.include? "substring"

We can do that using Ruby's .include? method, which evaluates to true if it finds what it's looking for and false otherwise.

(As a general rule, Ruby methods that end with ? evaluate to the boolean values true or false.)

Community Forums
Get help and ask questions in the Codecademy Forums
Report a Bug
If you see a bug or any other issue with this page, please report it here.