Rust Convert Strings to Integers, If Else Statements | Rust Programming | Kovolff
Channel: prelearn
Date: 2020-12-18

Use .trim() to remove any white space, i.e. carriage returns / new lines from user inputs

Defining constants in Rust is similar to declaring variables, except you use the word const instead of let.
i.e. const KEY_AGE: i64 = 18;

To convert a string to an integer, use parse

If statements in Rust are pretty straight forward
i.e. 
If test_age [comparison operator] KEY_AGE
{
 Then expression
}
else
{
 Else expression
}

#rust #strings #if #conditions #programming