Skip to content

Document why str.to_lowercase and str.to_uppercase return a String #39201

Closed
@Havvy

Description

@Havvy

I haven't checked, but I'm 95% certain that they do this because some characters expand into multiple characters when casefolding which wouldn't fit into the buffer of the str, so we need a new buffer. Since we don't know the size beforehand, we just return a String.

Probably should link to char.to_lowercase and char.to_uppercase.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions