PowerTip: Determine Letter a String Begins With
Summary: Use Windows PowerShell to determine the letter that a string begins with.
How can I use Windows PowerShell to find if a particular string begins with the letter “s”?
Use the StartsWith method from the string, for example:
PS C:\> "string".StartsWith("S")
PS C:\> "string".StartsWith("s")
Note The StartsWith method is case sensitive. Therefore “S” does not match the example, but “s” does.