CMDocuments/CombineVSMergeFilename.md
2025-03-27 23:59:06 +08:00

22 lines
725 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# filesystem/Filename.h
## MergeFilename
MergeFilename的用处理合并两个路径字符串段
它会处理各种隔离符重复、丢失问题。
比如合并"C:\"和"\Test"两个字符串,它会合并出"C:\Test",而不是"C:\\Test"
## Combine
Combine它的用处是合并多个字符串路径它支持任意个数的字符串数据但它不会处理隔离符问题而是单纯的合并。
比如:
Combine("A","B","C"),它会合并出来"ABC"
------------------------------------------------------
Combine("A:\","\B\",“\C”),它会合并出:"A:\\B\\C"
这里明显没有处理隔离符,所以得到了一个错误的结果。