❔ ✅ Parsing path into parts with varying separators?
The traditional way to do this would be
But what if the path uses / instead of \ because as far as I am aware Windows will understand this, but that wouldn't be the
DirectorySeparatorChar
?
Thanks!7 Replies
there is an overload that takes multiple characters to split on https://learn.microsoft.com/en-us/dotnet/api/system.string.split?view=net-7.0#system-string-split(system-char())
String.Split Method (System)
Returns a string array that contains the substrings in this instance that are delimited by elements of a specified string or Unicode character array.
cap5lut
REPL Result: Success
Result: string[]
Compile: 522.920ms | Execution: 32.986ms | React with ❌ to remove this embed.
Aha... I feel stupid now haha
Thank you
glad i could help, if ur question is answered please mark the thread as such by $closing it
Use the /close command to mark a forum thread as answered
Aha I was trying to find how you're meant to do that, thanks again 😛
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.