cTextSource text.
AdvPL GuideStrTokArr(cText,cToken) -> aPartsSplits a string into array elements.
Each cToken character acts independently as a delimiter. Thus "::" does not establish an indivisible sequence; check StrTokArr2 for composite delimiters. The source also documents stopping at the first ASCII 0. The example avoids empty fields and uses one delimiter, without inferring CSV quoting or escaping. (Sources: refs. 1–2.)
StrTokArr(cText,cToken) -> aPartscTextSource text.
cTokenDelimiter characters.
Array of parts.
#Include "Protheus.ch"
User Function Ed676()
Local aParts := StrTokArr("A;B;C",";")
// One position per token in this example without empty fields.
ConOut(Len(aParts))
ConOut(aParts[2])
Return NilDisplays 3 and B. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
© 2026 Usina.BR. All rights reserved. TOTVS, Protheus, Microsiga and their respective logos are trademarks of their owners. AdvPL Guide is independent and uses limited, attributed excerpts justified by educational purposes. See the Terms of Use. Terms of Use
Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.