(Lianja) StringBuilder GetNth
Demonstrates the GetNth method.
// The GetNth method is handy for getting parts from delimited strings.
// For example:
loSb = createobject("CkStringBuilder")
loSb.Append('red,blue,"green,purple",,yellow')
lcDelimiterChar = ","
llExceptDoubleQuoted = .T.
llExceptEscaped = .T.
// Prints "[red]"
? "[" + loSb.GetNth(0,lcDelimiterChar,llExceptDoubleQuoted,llExceptEscaped) + "]"
// Prints "[blue]"
? "[" + loSb.GetNth(1,lcDelimiterChar,llExceptDoubleQuoted,llExceptEscaped) + "]"
// Prints "[green,purple]"
? "[" + loSb.GetNth(2,lcDelimiterChar,llExceptDoubleQuoted,llExceptEscaped) + "]"
// Prints "[]"
? "[" + loSb.GetNth(3,lcDelimiterChar,llExceptDoubleQuoted,llExceptEscaped) + "]"
// Prints "[yellow]"
? "[" + loSb.GetNth(4,lcDelimiterChar,llExceptDoubleQuoted,llExceptEscaped) + "]"
// Prints "[]"
? "[" + loSb.GetNth(5,lcDelimiterChar,llExceptDoubleQuoted,llExceptEscaped) + "]"
release loSb
|