Hi, i’m working with paths in windows.
When i use String.indexOf(“/”) i get -1 even when there’s a slash in the path
If i use String.indexOf(“"”) happens the same.
Anyone knows how to get the index of a slash using windows paths?
Thanks.
Hi, i’m working with paths in windows.
When i use String.indexOf(“/”) i get -1 even when there’s a slash in the path
If i use String.indexOf(“"”) happens the same.
Anyone knows how to get the index of a slash using windows paths?
Thanks.
Try looking for the index of System.IO.Path.DirectorySeparatorChar instead, or “\” instead of “/”.
The value of this field is a slash (“/”) on UNIX, and a backslash (“\”) on the Windows and Macintosh operating systems.