Rust - Types - Strings


Contains

Returns true if a string contains a substring:

if s.contains("apple") {}
Lines

Iterate though each line in a string:

for line in s.lines() {}
Lowercase

Creates a new string containing the lowercase letters of the old string:

s.to_lowercase();
Binary Strings

Use b"" to create a binary string.