dtl-js
Version:
Data Transformation Language - JSON templates and data transformation
34 lines (26 loc) • 1.26 kB
Markdown
## `uc()` Function
### Description
The `uc()` function transforms the provided string into all uppercase characters. It is used to format strings where uppercase consistency is required, such as for displaying headers or acronyms.
### Usage
```
uc( $string )
```
- `$string`: The string to be converted to uppercase.
### Details
- Converts all characters in the string that have lowercase equivalents to their uppercase counterparts.
- Creates a new string with the uppercase conversion while preserving the original string.
### Example
```dtl
uc("Hello World")
```
This will return:
```
"HELLO WORLD"
```
### Considerations
- Characters in the string that do not have uppercase versions (such as numbers or punctuation) will remain unaffected.
- The input for the `uc()` function is expected to be a string. Providing a non-string input may yield unexpected behavior.
### Performance Implications
- The `uc()` function is typically low on processing overhead, making it suitable for high-volume or real-time data transformation processes.
### Note
- Utilize this function when data uniformity is critical, especially in cases where data may be input in mixed or varying case but must be processed in a uniform manner for consistency and reliability.