- StringAdd
- StringBufferLen
- StringCompare
- StringConcatenate
- StringFill
- StringFind
- StringGetCharacter
- StringInit
- StringLen
- StringSetLength
- StringReplace
- StringReserve
- StringSetChatacter
- StringSplit
- StringSubstr
- StringToLower
- StringToUpper
- StringTrimLeft
- StringTrimRight
StringReserve
保留内存中字符串的指定大小缓冲区。
bool StringReserve(
|
参数
string_var
[in][out] 用于更改缓冲区大小的字符串。
new_capacity
[in] 字符串所需的缓冲区大小。如果new_capacity大小小于字符串长度,那么当前缓冲区大小不会更改。
返回值
如果执行成功,返回true,否则 - false。若要接收错误代码,应该调用GetLastError()函数。
注意
通常,字符串大小不等于用于存储字符串的缓冲区大小。当创建字符串时,通常为相应的缓冲区分配一个空白区。StringReserve()函数可以管理缓冲区大小以及为以后操作指定最佳大小。
不同于 StringInit(),StringReserve()函数不更改字符串的内容,也不填充字符。
例如:
void OnStart()
|
另见
StringBufferLen,StringSetLength, StringInit,StringSetCharacter