Sha256: 8c7ba6a24989305dd2310643e42a1e438312eaf1aad99f6b17c819adcc51411a

Contents?: true

Size: 313 Bytes

Versions: 524

Compression:

Stored size: 313 Bytes

Contents

function CropText
{
  param($text, $fromPattern, $toPattern)
  
  $from, $to = ([regex]::matches($text, $fromPattern)), ([regex]::matches($text, $toPattern))
  if ($from.count -gt 0 -and $to.count -gt 0) {
    $text.substring($from[0].index, $to[0].index + $to[0].length - $from[0].index)
  } else {
    ""
  }
}

Version data entries

524 entries across 524 versions & 4 rubygems

Version Path
specinfra-2.91.0 lib/specinfra/backend/powershell/support/crop_text.ps1
specinfra-2.90.1 lib/specinfra/backend/powershell/support/crop_text.ps1
specinfra-2.90.0 lib/specinfra/backend/powershell/support/crop_text.ps1
specinfra-2.89.0 lib/specinfra/backend/powershell/support/crop_text.ps1
specinfra-2.88.2 lib/specinfra/backend/powershell/support/crop_text.ps1
specinfra-2.88.1 lib/specinfra/backend/powershell/support/crop_text.ps1
specinfra-2.88.0 lib/specinfra/backend/powershell/support/crop_text.ps1
specinfra-2.87.2 lib/specinfra/backend/powershell/support/crop_text.ps1
specinfra-2.87.1 lib/specinfra/backend/powershell/support/crop_text.ps1
specinfra-2.87.0 lib/specinfra/backend/powershell/support/crop_text.ps1
specinfra-2.86.0 lib/specinfra/backend/powershell/support/crop_text.ps1
specinfra-2.85.1 lib/specinfra/backend/powershell/support/crop_text.ps1
specinfra-2.85.0 lib/specinfra/backend/powershell/support/crop_text.ps1
specinfra-2.84.1 lib/specinfra/backend/powershell/support/crop_text.ps1
specinfra-2.84.0 lib/specinfra/backend/powershell/support/crop_text.ps1
specinfra-2.83.4 lib/specinfra/backend/powershell/support/crop_text.ps1
specinfra-2.83.3 lib/specinfra/backend/powershell/support/crop_text.ps1
specinfra-2.83.2 lib/specinfra/backend/powershell/support/crop_text.ps1
specinfra-2.83.1 lib/specinfra/backend/powershell/support/crop_text.ps1
specinfra-2.83.0 lib/specinfra/backend/powershell/support/crop_text.ps1