blob: 4140727d44a54dc21506bbdff538003d65c24828 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
//-----------------------------------------------------------------------
// <copyright file="Utilities.cs" company="Outercurve Foundation">
// Copyright (c) Outercurve Foundation. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace DotNetOpenAuth.BuildTasks {
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Text;
internal static class Utilities {
internal static string SuppressCharacters(string fileName, char[] suppress, char replacement) {
Contract.Requires<ArgumentNullException>(fileName != null);
Contract.Requires<ArgumentNullException>(suppress != null);
if (fileName.IndexOfAny(suppress) < 0) {
return fileName;
}
StringBuilder builder = new StringBuilder(fileName);
foreach (char ch in suppress) {
builder.Replace(ch, replacement);
}
return builder.ToString();
}
}
}
|