Str
    
            
            in package
            
        
    
    
    
FinalYes
Utilities for strings.
Tags
Table of Contents
Methods
- trim_prefix() : string
- Trims a string prefix when it matches. Example: `trim_prefix("Hello all", "Hello ") === "all"`.
- trim_suffix() : string
- Trims a string suffix when it matches. Example: `trim_suffix("Hello all", " all") === "Hello"`.
Methods
trim_prefix()
Trims a string prefix when it matches. Example: `trim_prefix("Hello all", "Hello ") === "all"`.
    public
            static        trim_prefix(string $string, string $prefix) : string
    Parameters
- $string : string
- 
                    the original string 
- $prefix : string
- 
                    the prefix to remove 
Tags
Return values
string —the resulting string
trim_suffix()
Trims a string suffix when it matches. Example: `trim_suffix("Hello all", " all") === "Hello"`.
    public
            static        trim_suffix(string $string, string $suffix) : string
    Parameters
- $string : string
- 
                    the original string 
- $suffix : string
- 
                    the suffix to remove 
Tags
Return values
string —the resulting string