BIS fnc trimString: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Page filling) |
m (template:command argument fix) |
||
Line 8: | Line 8: | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| Get a substring out of the string. |= | | Get a substring out of the string. |DESCRIPTION= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| [someText, beginning, length] call [[BIS_fnc_trimString]] |= | | [someText, beginning, length] call [[BIS_fnc_trimString]] |SYNTAX= | ||
|p1= someText: [[String]] - source string |= | |p1= someText: [[String]] - source string |PARAMETER1= | ||
|p2= beginning: [[Number]] (Optional, default 0) - start index; indexing starts at 0 |= | |p2= beginning: [[Number]] (Optional, default 0) - start index; indexing starts at 0 |PARAMETER2= | ||
|p3= length: [[Number]] (Optional, default end of string) - end index. A negative number means X chars ''from the string end'' |= | |p3= length: [[Number]] (Optional, default end of string) - end index. A negative number means X chars ''from the string end'' |PARAMETER3= | ||
| [[String]] |= | | [[String]] |RETURNVALUE= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
|x1= <code>["dreaded_is_the_man", 0, 6] [[call]] [[BIS_fnc_trimString]]; {{codecomment|// will return "dreaded"}}</code> |= | |x1= <code>["dreaded_is_the_man", 0, 6] [[call]] [[BIS_fnc_trimString]]; {{codecomment|// will return "dreaded"}}</code> |EXAMPLE1= | ||
|x2= <code>["dreaded_is_the_man", 15] [[call]] [[BIS_fnc_trimString]]; {{codecomment|// will return "man"}}</code> |= | |x2= <code>["dreaded_is_the_man", 15] [[call]] [[BIS_fnc_trimString]]; {{codecomment|// will return "man"}}</code> |EXAMPLE2= | ||
|x3= <code>["dreaded_is_the_man"] [[call]] [[BIS_fnc_trimString]]; {{codecomment|// will return "dreaded_is_the_man"}}</code> |= | |x3= <code>["dreaded_is_the_man"] [[call]] [[BIS_fnc_trimString]]; {{codecomment|// will return "dreaded_is_the_man"}}</code> |EXAMPLE3= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| |= | | |SEEALSO= | ||
}} | }} |
Revision as of 15:34, 7 April 2019
Description
- Description:
- Get a substring out of the string.
- Execution:
- call
- Groups:
- Uncategorised
Syntax
- Syntax:
- [someText, beginning, length] call BIS_fnc_trimString
- Parameters:
- someText: String - source string
- beginning: Number (Optional, default 0) - start index; indexing starts at 0
- length: Number (Optional, default end of string) - end index. A negative number means X chars from the string end
- Return Value:
- String
Examples
- Example 1:
["dreaded_is_the_man", 0, 6] call BIS_fnc_trimString; // will return "dreaded"
- Example 2:
["dreaded_is_the_man", 15] call BIS_fnc_trimString; // will return "man"
- Example 3:
["dreaded_is_the_man"] call BIS_fnc_trimString; // will return "dreaded_is_the_man"
Additional Information
- See also:
- See also needed
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Notes
- Posted on August 24, 2017 - 15:45 (UTC)
- Revo
-
"test" select [0,4];
Result: 0.0007 ms
["test",0,4] call BIS_fnc_trimString;
Result: 0.013 ms
The first method is about 18 times faster.