fix: improve doc link navigation and tree display
- Fix link resolution with proper relative/absolute path handling - Improve link styling with underline decoration - Hide leaf nodes from tree, only show directories - Fix log file path for packaged app
This commit is contained in:
39
docs/api/containers/string/clear.md
Normal file
39
docs/api/containers/string/clear.md
Normal file
@@ -0,0 +1,39 @@
|
||||
# String::Clear
|
||||
|
||||
```cpp
|
||||
void Clear();
|
||||
```
|
||||
|
||||
清空字符串内容,将长度设为 0,但不释放已分配的内存。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
```cpp
|
||||
#include "XCEngine/Containers/String.h"
|
||||
#include <iostream>
|
||||
|
||||
int main() {
|
||||
XCEngine::Containers::String s("Hello World");
|
||||
std::cout << "Before clear - Length: " << s.Length()
|
||||
<< ", Capacity: " << s.Capacity() << std::endl;
|
||||
// 输出: Before clear - Length: 11, Capacity: 12
|
||||
|
||||
s.Clear();
|
||||
std::cout << "After clear - Length: " << s.Length()
|
||||
<< ", Capacity: " << s.Capacity() << std::endl;
|
||||
// 输出: After clear - Length: 0, Capacity: 12
|
||||
std::cout << "Empty: " << s.Empty() << std::endl; // 输出: Empty: 1
|
||||
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [String 总览](string.md) - 返回类总览
|
||||
- [Reserve / Resize](reserve-resize.md) - 内存管理
|
||||
Reference in New Issue
Block a user