About 71,000 results
Open links in new tab
  1. string - Extract a substring using PowerShell - Stack Overflow

    The Substring method provides us a way to extract a particular string from the original string based on a starting position and length. If only one argument is provided, it is taken to be the …

  2. What is the equivalent of str.Substring in PowerShell?

    Sep 6, 2023 · Another option is to use PowerShell's regex-based -replace operator; the following uses a regex to match everything up to the last / character and - due to not specifying a …

  3. How to truncate text in string after/before separator in PowerShell ...

    How to truncate text in string after/before separator in PowerShell Asked 14 years, 10 months ago Modified 1 year, 3 months ago Viewed 385k times

  4. Check if a string contains any substring in an array in PowerShell

    I am studying PowerShell. I want to know how to check if a string contains any substring in an array in PowerShell. I know how to do the same in Python. The code is given below: any …

  5. powershell - How to get select-string to pipe to substring - Stack …

    Nov 14, 2022 · The alternative in PowerShell (Core) 7+ is to use Select-String 's -Raw switch, which results in only the matching lines getting output (as strings) to begin with; that is, the …

  6. Powershell - Extract strings before and after specific substring

    Nov 4, 2023 · I am trying to find a way to extract all text before and after a specific substring in a line. From the example below I want a way to find TEXT1 and TEXT2 programmatically. I …

  7. PowerShell and the -contains operator - Stack Overflow

    Sep 18, 2013 · The -Contains operator doesn't do substring comparisons and the match must be on a complete string and is used to search collections. From the documentation you linked to: …

  8. Find a substring in a string with PowerShell and trim

    Dec 16, 2018 · 4 I am trying to trim a string with PowerShell. Let's say you have the following string: Test test test test test test /abc test test test I want to 'find' the '/a' in the string and …

  9. Extract a substring with a regular expression in PowerShell

    Apr 23, 2019 · Extract a substring with a regular expression in PowerShell Asked 12 years, 6 months ago Modified 2 years, 6 months ago Viewed 51k times

  10. Substring in PowerShell to truncate string length

    Jan 14, 2015 · Is it possible in PowerShell, to truncate a string, (using SubString ()?), to a given maximum number of characters, even if the original string is already shorter?