type
returns
method
string
name
description
size
int
the amount of characters to grab
Returns a substring of the given size, starting at the string's first index. Roughly equivilent to #slice(0, size)
#slice(0, size)
"Hello, World".head(5) == "Hello" "Hi".head(3) == "Hi"
Last updated 5 years ago
Was this helpful?