Version: v0.8.1 - Beta.  We welcome contributors & feedback.

String.prepend

prepend($leftString) -> string

Description

Add $leftString to the beginning of the string.

This is equivalent to the string-append ~ operator, but is easier to chain with other methods.

'123'.prepend('abc-')
//= 'abc-123'

'123'.prepend('abc-').toUpperCase()
//= 'ABC-123'

See Also