Feature: Str class
Problem Statement
Hazaar currently lacks a dedicated utility class for handling common string operations. Similar to how the Arr
class was created to provide array helper functions, a Str
class should be introduced to provide a centralized and efficient way to handle string-related operations.
Who will benefit?
- Developers working with string manipulation in Hazaar.
- Applications that require consistent and reusable string processing functions.
- Codebases looking to reduce redundancy in string handling logic.
Benefits and risks
Benefits
- Consistency: Provides a standardized way to handle string operations.
- Code Reusability: Eliminates the need for repetitive string processing logic.
- Performance: Optimized string handling for better efficiency.
Risks
-
Naming Conflicts: Ensure the class name
Str
does not conflict with existing implementations. - Scope Creep: The class should remain focused on essential and commonly used string operations.
Proposed Solution
- Create a
Str
class within the Hazaar framework. - Implement commonly used string helper functions such as:
- Case conversion (camelCase, snake_case, kebab-case, etc.)
- Trimming and sanitization
- String length and manipulation utilities
- Encoding/decoding helpers
- Ensure the methods follow best practices and efficient implementations.
- Document usage examples for developers.
Priority/Severity
-
High (This will bring a huge increase in performance/productivity/usability/legislative cover) -
Medium (This will bring a good increase in performance/productivity/usability) -
Low (anything else e.g., trivial, minor improvements)