![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(PowerShell) StringBuilder GetNthDemonstrates the GetNth method.
Add-Type -Path "C:\chilkat\ChilkatDotNet47-x64\ChilkatDotNet47.dll" # The GetNth method is handy for getting parts from delimited strings. # For example: $sb = New-Object Chilkat.StringBuilder $sb.Append("red,blue,`"green,purple`",,yellow") $delimiterChar = "," $exceptDoubleQuoted = $true $exceptEscaped = $true # Prints "[red]" $("[" + $sb.GetNth(0,$delimiterChar,$exceptDoubleQuoted,$exceptEscaped) + "]") # Prints "[blue]" $("[" + $sb.GetNth(1,$delimiterChar,$exceptDoubleQuoted,$exceptEscaped) + "]") # Prints "[green,purple]" $("[" + $sb.GetNth(2,$delimiterChar,$exceptDoubleQuoted,$exceptEscaped) + "]") # Prints "[]" $("[" + $sb.GetNth(3,$delimiterChar,$exceptDoubleQuoted,$exceptEscaped) + "]") # Prints "[yellow]" $("[" + $sb.GetNth(4,$delimiterChar,$exceptDoubleQuoted,$exceptEscaped) + "]") # Prints "[]" $("[" + $sb.GetNth(5,$delimiterChar,$exceptDoubleQuoted,$exceptEscaped) + "]") |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.