Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[10.x] Create fluent method convertCase (#48492)
* Add method `Str::convertCase` This function, convertCase, serves the purpose of converting the case of a given string while taking into account multibyte characters and character encoding. It offers flexibility by allowing you to specify the conversion mode and character encoding, with sensible defaults provided for ease of use. Here's a breakdown of its functionality: String: You provide a string as the input, which is the text you want to change the case of. Conversion Mode (Optional): The function allows you to specify the conversion mode through the $mode parameter. By default, it uses MB_CASE_FOLD, which converts the string to lowercase. However, you can change this mode according to your requirements. Character Encoding (Optional): You can also specify the character encoding through the $encoding parameter. The default encoding is 'UTF-8,' but you can set it to a different encoding if needed. If no encoding is provided, it will use the internal encoding. Output: The function returns the converted string with the specified case and encoding. * Adjust StyleCI * formatting * [10.x] Create fluent method convertCase * [10.x] Return New Stringable --------- Co-authored-by: Taylor Otwell <[email protected]> Co-authored-by: rmunate <[email protected]>
- Loading branch information