Introduction to stringr

The package stringr is useful for playing with strings.

How to upper string

ma_chaine <- "Hello work !"

ma_chaine_trans <- ma_chaine |> stringr::str_to_upper()

How to extract substring

ma_chaine <- "Il fait beau et chaud aujourd'hui"

ma_chaine_extrait <- ma_chaine |> stringr::str_extract(pattern = "[a-z]{4} et ")

Onyxia