Reading time: 1 minute
A função StrTokArr em ADVPL separa uma string passada como parâmetro. Essa quebra é feita baseada no separador informado, que pode ser um ou mais caracteres. Ao final ela retorna um array, onde cada porção da string separada é um elemento desse array. StrTokArr é uma das funções de manipulação de string em ADVPL.
Sintaxe:
StrTokArr(cString,cSep)
Parâmetro(s):
Retorno:
Exemplo de StrTokArr ADVPL:
#include 'protheus.ch'
/*{Protheus.doc} User Function fStrTokA
(Essa função tem por finalidade mostrar a função de Manipulação de String StrTokArr em ADVPL)
@type Function
@author Adilio Costa
@since 16/08/2024
@version 1.0
@Inscreva-se no Blog ProtheusAdvpl:
https://www.protheusadvpl.com.br
@Inscreva-se no Canal ProtheusAdvpl:
https://www.youtube.com/protheusadvpl
@Siga-nos no Instagram:
https://www.instagram.com/protheusadvpl
@Conheça os Cursos do Portal ProtheusAdvpl:
https://hotmart.com/pt-br/club/portal-protheusadvpl
|Se esse conteúdo foi útil pra você nos ajude divulgando
ele e nossas redes sociais!!|
*/
User Function fStrTokA()
Local cStr := "ADVPL I;ADVPL II;ADVPL III;TLPP"
Local cSep := ";"
Local aDados := StrTokArr(cStr,cSep)
Local nI
Local cInfo := ""
For nI := 1 To Len(aDados)
cInfo +="Elemento "+cValToChar(nI)+":"+aDados[nI]+Chr(10)+Chr(13)
Next nI
If(Len(aDados)>0)
MsgInfo(cInfo,"Exemplo da Função StrToKArr")
EndIf
Return
No código ADVPL acima passamos a variável cStr com seus conteúdos separados por “;” e informamos ela e a variável cSep para a função StrToKArr e a mesma quebrou o conteúdo de cStr utilizando o separador de cSep e assim retornou um array aDados com cada elemento de cStr:
É isso aí, finalizamos aqui o post aqui do Blog ProtheusAdvpl. Caso tenha ficado alguma dúvida deixe seu comentário ou nos envie um e-mail para adiliocosta@protheusadvpl.com.br, até um próximo post, grande abraço e fica com Deus.
Link(s) de referência(s):
Permalink
I’ve been following your blog for some time now, and I’m consistently blown away by the quality of your content. Your ability to tackle complex topics with ease is truly admirable.
Permalink
I just could not depart your web site prior to suggesting that I really loved the usual info an individual supply in your visitors Is gonna be back regularly to check up on new posts
Permalink
I loved as much as youll receive carried out right here The sketch is attractive your authored material stylish nonetheless you command get bought an nervousness over that you wish be delivering the following unwell unquestionably come more formerly again as exactly the same nearly a lot often inside case you shield this hike
Permalink
Your blog has become an indispensable resource for me. I’m always excited to see what new insights you have to offer. Thank you for consistently delivering top-notch content!
Permalink
Hi my family member I want to say that this post is awesome nice written and come with approximately all significant infos I would like to peer extra posts like this
Permalink
Your blog has quickly become one of my favorites. Your writing is both insightful and thought-provoking, and I always come away from your posts feeling inspired. Keep up the phenomenal work!
Permalink
Its like you read my mind You appear to know a lot about this like you wrote the book in it or something I think that you could do with some pics to drive the message home a little bit but instead of that this is fantastic blog An excellent read I will certainly be back
Permalink
Thank you for the good writeup It in fact was a amusement account it Look advanced to far added agreeable from you However how could we communicate
Permalink
оземпик 1 5 – оземпик купить москва +и область, оземпик +в новосибирске
Permalink
1
Permalink
1
Permalink
1*1
Permalink
1+496-491-5
Permalink
./1
Permalink
-1 OR 3+185-185-1=0+0+0+1
Permalink
1
Permalink
1
Permalink
1*if(now()=sysdate(),sleep(15),0)
Permalink
http://dicrpdbjmemujemfyopp.zzz/yrphmgdpgulaszriylqiipemefmacafkxycjaxjs%3F.jpg
Permalink
1-1); waitfor delay ‘0:0:15’ —
Permalink
c:/windows/win.ini
Permalink
bxss.me
Permalink
1
Permalink
1-1 waitfor delay ‘0:0:15’ —
Permalink
1
Permalink
1
Permalink
1’||DBMS_PIPE.RECEIVE_MESSAGE(CHR(98)||CHR(98)||CHR(98),15)||’
Permalink
1′”
Permalink
@@1y60Q
Permalink
1
Permalink
1
Permalink
1
Permalink
1
Permalink
1
Permalink
1