Sample code for 30+ languages & platforms
VB.NET

StringBuilder GetNth

Demonstrates the GetNth method.

Chilkat VB.NET Downloads

VB.NET
' The GetNth method is handy for getting parts from delimited strings.
' For example:

Dim sb As New Chilkat.StringBuilder
sb.Append("red,blue,""green,purple"",,yellow")

Dim delimiterChar As String = ","
Dim exceptDoubleQuoted As Boolean = True
Dim exceptEscaped As Boolean = True

' Prints "[red]"
Debug.WriteLine("[" & sb.GetNth(0,delimiterChar,exceptDoubleQuoted,exceptEscaped) & "]")

' Prints "[blue]"
Debug.WriteLine("[" & sb.GetNth(1,delimiterChar,exceptDoubleQuoted,exceptEscaped) & "]")

' Prints "[green,purple]"
Debug.WriteLine("[" & sb.GetNth(2,delimiterChar,exceptDoubleQuoted,exceptEscaped) & "]")

' Prints "[]"
Debug.WriteLine("[" & sb.GetNth(3,delimiterChar,exceptDoubleQuoted,exceptEscaped) & "]")

' Prints "[yellow]"
Debug.WriteLine("[" & sb.GetNth(4,delimiterChar,exceptDoubleQuoted,exceptEscaped) & "]")

' Prints "[]"
Debug.WriteLine("[" & sb.GetNth(5,delimiterChar,exceptDoubleQuoted,exceptEscaped) & "]")