- Home /
This question was
closed Jul 12, 2011 at 10:31 PM by
Chris D for the following reason:
http://answers.unity3d.com/questions/142760/os-specific-paths-in-strings.html
Question by
claudekennilol · Jul 12, 2011 at 10:30 PM ·
osstring formatting
os specific paths in strings?
I've got this for my path
private string outputLocation = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
private string macOut = @"/ArtifactExampleXML.xml";
private string winOut = @"\ArtifactExampleXML.xml";
and this in my constructor
public XMLParser(){ if (SystemInfo.operatingSystem.Contains("Mac")) outputLocation = outputLocation + macOut; else outputLocation = outputLocation + winOut; }There's got to be a way around this and just have it know which way the string should be formatted.. Can someone shed some light on my situation?
Comment
Follow this Question
Related Questions
os specific paths in strings? 1 Answer
How would I make an Operating System? 1 Answer
Preformance difference between build on macOS and Windows 0 Answers
String format not working 1 Answer