Skip to content

[String] FR: snake case but with underscore before numbers #34777

Closed
@simPod

Description

@simPod

Description
I have not found a way how to convert Something1 into something_1 with String component. snake() method converts Something1 into something1 which I think is correct behaviour.

I wonder what if we added a new method, like underscore() that would do the conversion mentioned above?

Example

assertSame('something_1', u('Something1')->underscore()->toString());

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions