d47081
December 12, 2024, 6:24am
1
In PHP, there is DIRECTORY_SEPARATOR
constant, useful for Windows and Unix paths resolve, what about Rust?
Thoughts use with .replace("/", "-")
, not sure I want operate with strings regex, array or multiple replace
chain here
UPD seems, found it:
std::path::MAIN_SEPARATOR
What are you trying to solve? If you are trying to replace all separator in a path with some other symbols to generate a single identifier, I think you should call Path::components and compose the components.
2 Likes
d47081
December 12, 2024, 8:30am
3
At this moment just trying to replace "/"
with const, as updated before, solution found:
std::path::MAIN_SEPARATOR
Thanks, closed!
system
Closed
March 12, 2025, 8:31am
4
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.