BIS fnc trimString: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\{\{ *codecomment *\| *\/\/ *([^ ]+) *\}\} " to "{{cc|$1}}")
m (revert + fix)
Tag: Undo
Line 1: Line 1:
{{RV|type=function
{{RV|type=function
| arma3|1.00|gr1 = Strings| Get a substring out of the string.| [someText, beginning, length] call [[BIS_fnc_trimString]]|p1= someText: [[String]] - source string|p2= beginning: [[Number]] (Optional, default 0) - start index; indexing starts at 0|p3= length: [[Number]] (Optional, default end of string) - end index. A negative number means X chars ''from the string end''| [[String]]|x1= <code>["dreaded_is_the_man", 0, 6] [[call]] [[BIS_fnc_trimString]]; {{cc| will return "dreaded"}}</code>|x2= <code>["dreaded_is_the_man", 15] [[call]] [[BIS_fnc_trimString]]; {{codecomment|// will return "man"}}</code>|x3= <code>["dreaded_is_the_man"] [[call]] [[BIS_fnc_trimString]]; {{codecomment|// will return "dreaded_is_the_man"}}</code>|}}
 
|game1= arma3
 
|version1= 1.00
 
|gr1= Strings
 
|descr= Get a substring out of the string.
 
|s1= [someText, beginning, length] call [[BIS_fnc_trimString]]
 
|p1= someText: [[String]] - source string
 
|p2= beginning: [[Number]] (Optional, default 0) - start index; indexing starts at 0
 
|p3= length: [[Number]] (Optional, default end of string) - end index. A negative number means X chars ''from the string end''
 
|r1= [[String]]
 
|x1= <code>["dreaded_is_the_man", 0, 6] [[call]] [[BIS_fnc_trimString]]; {{cc|will return "dreaded"}}</code>
 
|x2= <code>["dreaded_is_the_man", 15] [[call]] [[BIS_fnc_trimString]]; {{cc|will return "man"}}</code>
 
|x3= <code>["dreaded_is_the_man"] [[call]] [[BIS_fnc_trimString]]; {{cc|will return "dreaded_is_the_man"}}</code>
}}
 
<!-- CONTINUE Notes -->
<!-- CONTINUE Notes -->


Line 16: Line 41:
</dl>
</dl>
<!-- DISCONTINUE Notes -->
<!-- DISCONTINUE Notes -->
[[Category:Functions|{{uc:trimString}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:trimString}}]]

Revision as of 18:17, 29 January 2021

Hover & click on the images for description

Description

Description:
Get a substring out of the string.
Execution:
call
Groups:
Strings

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


Posted on August 24, 2017 - 15:45 (UTC)
R3vo
"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.