选择字符串和区分大小写 [英] Selecting strings and case sensitivity

查看:46
本文介绍了选择字符串和区分大小写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试过滤具有 Title 字段的对象,但我想忽略大小写.如果关闭,有没有办法确保区分大小写?

I am trying to filter for an object that has a Title field, and I want to ignore case. Is there a way to make sure case sensitivity if turned off?

| Where-Object {$_.Title -like "myString"}

推荐答案

PowerShell 基本上不区分大小写(例如 "HEy" -like "hey"True).

PowerShell is fundamentally case insensitive (e.g. "HEy" -like "hey" is True).

如果要使用like的区分大小写版本,请使用-clike.

If you want to use the case sensitive version of like, use -clike.

这篇关于选择字符串和区分大小写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆