added string functions ensure_starts_with and ensure_ends_with