Ruby Language Strings Formatted strings

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

Ruby can inject an array of values into a string by replacing any placeholders with the values from the supplied array.

"Hello %s, my name is %s!" % ['World', 'br3nt']
# => Hello World, my name is br3nt!

The place holders are represented by two %s and the values are supplied by the array ['Hello', 'br3nt']. The % operator instructs the string to inject the values of the array.



Got any Ruby Language Question?