# Case Insensitive

**URL:** <https://forums.powershell.org/t/case-insensitive/4153>\
**Category:** PowerShell Help\
**Created:** [May 5, 2015, 6:33am UTC](https://forums.powershell.org/t/case-insensitive/4153 "2015-05-05T06:33:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikhael-kaendera](https://avatars.discourse-cdn.com/v4/letter/m/c5a1d2/32.png) [@mikhael-kaendera](https://forums.powershell.org/u/mikhael-kaendera)\
**Post date:** [May 5, 2015, 6:33am UTC](https://forums.powershell.org/t/case-insensitive/4153/1 "2015-05-05T06:33:12Z")

</div>

Is there away to make the Replace function case insensitive.

Replace(‘Host=“ACfile01”’,‘Host=“vCHPprt02”’)

I also want to be able to replace the following line

Replace(‘Host=“ACFile01”’,‘Host=“vCHPprt02”’)

---

<div class="post-metadata">

**Author:** ![bobmccoy](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/bobmccoy/32/650_2.png) [@bobmccoy](https://forums.powershell.org/u/bobmccoy)\
**Post date:** [May 5, 2015, 6:41am UTC](https://forums.powershell.org/t/case-insensitive/4153/2 "2015-05-05T06:41:37Z")

</div>

You could use the -replace operator instead of the .Replace() method.

```
"FooBar" -replace "foo","Tango"
```

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:45pm UTC](https://forums.powershell.org/t/case-insensitive/4153/3 "2024-05-16T20:45:21Z")

</div>

Closed on May 16, 2024, 8:45pm UTC


