Head

Arguments

Explanation

Returns a substring of the given size, starting at the string's first index. Roughly equivilent to #slice(0, size)

Examples

"Hello, World".head(5) == "Hello"
"Hi".head(3) == "Hi"

Last updated