Feature: Str class #325

Closed
opened 2025-03-09 09:41:34 +00:00 by jamie · 4 comments
jamie commented 2025-03-09 09:41:34 +00:00 (Migrated from git.hazaar.io)

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

  1. Create a Str class within the Hazaar framework.
  2. 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
  3. Ensure the methods follow best practices and efficient implementations.
  4. 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)
## 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 1. Create a `Str` class within the Hazaar framework. 2. 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 3. Ensure the methods follow best practices and efficient implementations. 4. Document usage examples for developers. ## Priority/Severity - [x] 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)
jamie commented 2025-03-09 09:41:34 +00:00 (Migrated from git.hazaar.io)

assigned to @jamie

assigned to @jamie
jamie commented 2025-03-09 09:41:39 +00:00 (Migrated from git.hazaar.io)

created branch 325-feature-str-class to address this issue

created branch [`325-feature-str-class`](/hazaar/framework/-/compare/master...325-feature-str-class) to address this issue
jamie commented 2025-03-09 09:41:50 +00:00 (Migrated from git.hazaar.io)

mentioned in merge request !210

mentioned in merge request !210
jamie commented 2025-03-09 10:29:54 +00:00 (Migrated from git.hazaar.io)

mentioned in commit 12525e721f

mentioned in commit 12525e721f2573872e0e5e7e450e1734889a3e1b
jamie (Migrated from git.hazaar.io) closed this issue 2025-03-09 10:29:54 +00:00
jamie self-assigned this 2025-09-04 01:14:39 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: hazaar/framework#325
No description provided.