Parsing an arbitrary file path as a Uri or similar
Hello there. I would like to be able to parse the following inputs in such a way that I'm aware if they are a relative or absolute path:
I'm having trouble getting this to work with
Uri.TryCreate()
. they all return false
for their IsAbsoluteUri
properties, when at least the second one should be true
. I'm not sure what properties or methods I should utilize to obtain the information I'm after.
Any pointers/tips?5 Replies
Kouhai#8274
REPL Result: Success
Compile: 535.942ms | Execution: 28.784ms | React with ❌ to remove this embed.
Idk how to make modix show the output but this should work
It'll return
true
for absolute pathsNeat, that does seem to work.
I actually realized, this is pointless. File.ReadAllText already supports relative paths, so these three examples work right out of the box. I had a feeling I was overthinking things.
Oh <a:Haato_Notlikethis:714703964741828629>
JakenVeina#1758
REPL Result: Success
Console Output
Compile: 572.202ms | Execution: 26.753ms | React with ❌ to remove this embed.