Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(PowerBuilder) StringBuilder GetNthDemonstrates the GetNth method.
integer li_rc oleobject loo_Sb string ls_DelimiterChar integer li_ExceptDoubleQuoted integer li_ExceptEscaped // The GetNth method is handy for getting parts from delimited strings. // For example: loo_Sb = create oleobject // Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0 li_rc = loo_Sb.ConnectToNewObject("Chilkat.StringBuilder") if li_rc < 0 then destroy loo_Sb MessageBox("Error","Connecting to COM object failed") return end if loo_Sb.Append("red,blue,~"green,purple~",,yellow") ls_DelimiterChar = "," li_ExceptDoubleQuoted = 1 li_ExceptEscaped = 1 // Prints "[red]" Write-Debug "[" + loo_Sb.GetNth(0,ls_DelimiterChar,li_ExceptDoubleQuoted,li_ExceptEscaped) + "]" // Prints "[blue]" Write-Debug "[" + loo_Sb.GetNth(1,ls_DelimiterChar,li_ExceptDoubleQuoted,li_ExceptEscaped) + "]" // Prints "[green,purple]" Write-Debug "[" + loo_Sb.GetNth(2,ls_DelimiterChar,li_ExceptDoubleQuoted,li_ExceptEscaped) + "]" // Prints "[]" Write-Debug "[" + loo_Sb.GetNth(3,ls_DelimiterChar,li_ExceptDoubleQuoted,li_ExceptEscaped) + "]" // Prints "[yellow]" Write-Debug "[" + loo_Sb.GetNth(4,ls_DelimiterChar,li_ExceptDoubleQuoted,li_ExceptEscaped) + "]" // Prints "[]" Write-Debug "[" + loo_Sb.GetNth(5,ls_DelimiterChar,li_ExceptDoubleQuoted,li_ExceptEscaped) + "]" destroy loo_Sb |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.