trim: Difference between revisions
Lou Montana (talk | contribs) m (Some wiki formatting) |
BrettMayson (talk | contribs) mNo edit summary |
||
| Line 20: | Line 20: | ||
|p22= chars: [[String]] - list of characters to be trimmed | |p22= chars: [[String]] - list of characters to be trimmed | ||
|p23= where: [[Number]] | |p23= where: [[Number]] one of: | ||
* 0 - trim at the beginning (left) and the end (right) | * 0 - trim at the beginning (left) and the end (right) | ||
* 1 - trim at the beginning (left) | * 1 - trim at the beginning (left) | ||
Latest revision as of 10:06, 1 January 2026
Description
Syntax
- Syntax:
- trim stringValue
- Parameters:
- stringValue: String - string to be trimmed. spaces, tabs and line returns are removed from both ends of stringValue.
- Return Value:
- String - trimmed string
Alternative Syntax
- Syntax:
- string trim [chars, where]
- Parameters:
- string: String - string to be trimmed
- chars: String - list of characters to be trimmed
- where: Number one of:
- 0 - trim at the beginning (left) and the end (right)
- 1 - trim at the beginning (left)
- 2 - trim at the end (right)
- Return Value:
- String - trimmed string
Examples
- Example 1:
- trim " hello, how are you? "; // returns "hello, how are you?"
- Example 2:
- "hewosentence!123" trim ["3e1o2hw", 0]; // returns "sentence!"
Additional Information
- See also:
- select
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord.
Only post proven facts here! Add Note