Path.Combine says "Illegal character in path"
This is the path. Why is it illegal?
C:\Users\itsbl\AppData\LocalLow\bl4ckdev x XDev\Airborne\Levels\Untitled (143).level
7 Replies
Are you @ing the string?
well there isn't anything to @ since it's like this
Ah
I don't see anything illegal, can you show more code?
Well, this is pretty much the code that throws the error, every file-related operation does it as well
Check your string against https://learn.microsoft.com/en-us/dotnet/api/system.io.path.getinvalidpathchars?view=net-8.0
Path.GetInvalidPathChars Method (System.IO)
Gets an array containing the characters that are not allowed in path names.
Nevermind, got it
it was a newline 😶
You can always validate the path characters using the method above