You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add optional padding character to padLeft/padRight, new padBoth function, and optional chars parameter to trim (#10)
* Add third optional parameter to padLeft/padRight and implement padBoth function
* Add optional second parameter to trim function for custom characters
Copy file name to clipboardExpand all lines: docs/syntax.md
+9-3Lines changed: 9 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,7 +112,7 @@ The parser includes comprehensive string manipulation capabilities.
112
112
113
113
| Function | Description |
114
114
|:---------------- |:----------- |
115
-
| trim(str) | Removes whitespace from both ends of a string. |
115
+
| trim(str, chars?)| Removes whitespace (or specified characters) from both ends of a string. |
116
116
| toUpper(str) | Converts a string to uppercase. |
117
117
| toLower(str) | Converts a string to lowercase. |
118
118
| toTitle(str) | Converts a string to title case (capitalizes first letter of each word). |
@@ -151,8 +151,9 @@ The parser includes comprehensive string manipulation capabilities.
151
151
152
152
| Function | Description |
153
153
|:--------------------- |:----------- |
154
-
| padLeft(str, len) | Pads a string on the left with spaces to reach the target length. |
155
-
| padRight(str, len) | Pads a string on the right with spaces to reach the target length. |
154
+
| padLeft(str, len, padChar?) | Pads a string on the left with spaces (or optional padding character) to reach the target length. |
155
+
| padRight(str, len, padChar?) | Pads a string on the right with spaces (or optional padding character) to reach the target length. |
156
+
| padBoth(str, len, padChar?) | Pads a string on both sides with spaces (or optional padding character) to reach the target length. If an odd number of padding characters is needed, the extra character is added on the right. |
0 commit comments