Ensures that the string begins with $substring. If it doesn't, it's prepended.

string:ensure_start(STRING $string, STRING $start) : STRING

string:ensure_start('foo','!')
#=> "!foo"

string:ensure_start('foo','f')
#=> "foo"

string:ensure_start('foo','bar')
#=> "barfoo"

string:ensure_start('foo','')
#=> "foo"

string:ensure_start('','')
#=> ""

Copyright ©2013-2022 SunSed®. All rights reserved.