StringInit
Initializes a string by specified symbols and provides the specified string size.
bool StringInit(
string& string_var,
int new_len=0,
ushort character=0
); |
Parameters
string_var
[in][out] String that should be initialized and deinitialized.
new_len=0
[in] String length after initialization. If length=0, it deinitializes the string, i.e. the string buffer is cleared and the buffer address is zeroed.
character=0
[in] Symbol to fill the string.
Return Value
Note
Example:
void OnStart()
{
//---
string str;
StringInit(str,200,0);
Print("str = ",str,": StringBufferLen(str) = ",
StringBufferLen(str)," StringLen(str) = ",StringLen(str));
}
/* Result
str = : StringBufferLen(str) = 200 StringLen(str) = 0
*/ |
See also
StringBufferLen, StringLen