diff --git a/src/Umbraco.Core/StringExtensions.cs b/src/Umbraco.Core/StringExtensions.cs
index d61c0a87ca..9152d686a2 100644
--- a/src/Umbraco.Core/StringExtensions.cs
+++ b/src/Umbraco.Core/StringExtensions.cs
@@ -938,7 +938,22 @@ namespace Umbraco.Core
return text;
}
+ ///
+ /// Returns a new string in which only the first occurrence of a specified string is replaced by a specified replacement string.
+ ///
+ /// The string to filter.
+ /// The string to replace.
+ /// The replacement string.
+ /// The filtered string.
+ public static string ReplaceFirst(this string text, string search, string replace)
+ {
+ var pos = text.IndexOf(search);
+ if (pos < 0)
+ return text;
+
+ return text.Substring(0, pos) + replace + text.Substring(pos + search.Length);
+ }
diff --git a/src/Umbraco.Web/Editors/CodeFileController.cs b/src/Umbraco.Web/Editors/CodeFileController.cs
index 325b39e4f2..2de3283b95 100644
--- a/src/Umbraco.Web/Editors/CodeFileController.cs
+++ b/src/Umbraco.Web/Editors/CodeFileController.cs
@@ -5,7 +5,6 @@ using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
-using ClientDependency.Core;
using Umbraco.Core;
using Umbraco.Core.Cache;
using Umbraco.Core.Configuration;