Start learning free

LESSON 7 OF 414 · WELCOME TO RUST

Strings vs Numbers in Rust

Lesson

  • Rust distinguishes between numbers and strings!


  • In Rust, "15" (with quotes) is considered a string (&str), while 15 (without quotes) is considered a number (i32 by default).


  • For example, computers can perform mathematical operations on numbers, but not on strings. More on this in the next lessons.

STEP 1 OF 1
    Ctrl + Enter to check