diff options
author | Ignacio Roldán Etcheverry <neikeq@users.noreply.github.com> | 2020-05-10 13:33:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-10 13:33:03 +0200 |
commit | 54b20a25b90c8c8d8dfd7f68d66d0ec57c71435f (patch) | |
tree | ed0fd3e030e6f65568f664bc9f5d2bb028f37618 /modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs | |
parent | da898c116c0b45ff0dc16e80800f8694339cd4f1 (diff) | |
parent | 3ce09246d10a267bf00ae8bf37068ec458c69287 (diff) | |
download | redot-engine-54b20a25b90c8c8d8dfd7f68d66d0ec57c71435f.tar.gz |
Merge pull request #38600 from neikeq/no
Switch to nuget Microsoft.Build and rewrite GodotTools messasing protocol
Diffstat (limited to 'modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs')
-rw-r--r-- | modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs b/modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs index 326c49f096..7ab5c5fc59 100644 --- a/modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs +++ b/modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs @@ -33,23 +33,13 @@ namespace GodotTools.Core return rooted ? Path.DirectorySeparatorChar + path : path; } - private static readonly string driveRoot = Path.GetPathRoot(Environment.CurrentDirectory); + private static readonly string DriveRoot = Path.GetPathRoot(Environment.CurrentDirectory); public static bool IsAbsolutePath(this string path) { return path.StartsWith("/", StringComparison.Ordinal) || path.StartsWith("\\", StringComparison.Ordinal) || - path.StartsWith(driveRoot, StringComparison.Ordinal); - } - - public static string CsvEscape(this string value, char delimiter = ',') - { - bool hasSpecialChar = value.IndexOfAny(new char[] { '\"', '\n', '\r', delimiter }) != -1; - - if (hasSpecialChar) - return "\"" + value.Replace("\"", "\"\"") + "\""; - - return value; + path.StartsWith(DriveRoot, StringComparison.Ordinal); } public static string ToSafeDirName(this string dirName, bool allowDirSeparator) |