<p>I have an application in which HttpRuntime.AppDomainAppPath returns the correct path with the wrong casing.</p>

<p>I am then trying to use this in a String.Replace and it does not find the path in the filename due to casing.</p>

<p>I am aware that I can use Regex.Replace but would prefer not to.</p>

<p>I have this problem only on the production machine even though the folder in question has the same casing in dev.</p>

<p>I have just noticed that Server.MapPath also returns the wrong casing.</p>

<p>Any ideas?</p>

A few things:
If you don't care about casing, use .ToUpper or .ToLower, and replace on that.
```
```
Dim path As String = HttpRuntime.AppDomainAppPath.ToUpper
Dim newpath As String = Replace(path, "fnd", "rplc")
```
```
If that is not an option try changing the compare method in your replace function.
You didn't specify a language, so I cannot give a specific example.