Cheddar Documentation
Searchโ€ฆ
Tail
type
returns
method
string

Arguments

name
type
description
size
int
the amount of characters to grab

Explanation

Returns a substring of the given size, starting at the string's last character. Roughly equivilent to #slice(-size)

Examples

1
"Hello!".tail(1) == "!"
2
// Goat emoji is a surrogate of two bytes
3
"๐Ÿ‘๐Ÿ".tail(2) == "๐Ÿ"
Copied!
Last modified 1yr ago