name <- "Maria" age <- 29 sprintf("%s is %d years old", name, age) # "Maria is 29 years old" price <- 19.5 sprintf("Total: $%.2f", price) # "Total: $19.50"
Click Run to execute this code.