PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WINDEV 2024 → Complete (Function) Left
Complete (Function) Left
Iniciado por marcov, mai., 07 2024 6:33 PM - 6 respostas
Membro registado
56 mensagems
Publicado em maio, 07 2024 - 6:33 PM
hi,
How can I complete a string but from the left?

thanks
Membro registado
59 mensagems
Publicado em maio, 10 2024 - 11:38 AM
Procedure LeftComplete(sInitialString is string, nFinalLenght is int)

RESULT Complete("",nFinalLenght-Length(sInitialString))+sInitialString
Membro registado
25 mensagems
Publicado em maio, 14 2024 - 12:48 AM
If only the Complete function had a parameter to complete on the left!
Publicado em maio, 28 2024 - 6:06 PM
Here's how it can be done using built in functions:

StringReverse(Complete(StringReverse("TEST_STRING"), 25, "A"))


This will return "AAAAAAAAAAAAA_TEST_STRING"


BR
Publicado em julho, 15 2024 - 12:47 PM
A1 is string = "SANJOG"

A2 is string = RepeatString("0", Max(0, 10 - Length(A1))) + A1

Output : A2 = "0000SANJOG"

(You can change according to your requirement)
"0" = Padding element
10 = limit for string length
Membro registado
2 mensagems
Publicado em julho, 15 2024 - 1:05 PM
A1 is string = "SANJOG"

A2 is string = RepeatString("0", Max(0, 10 - Length(A1))) + A1

Output : A2 = "0000SANJOG"

(You can change according to your requirement)
"0" = Padding element
10 = limit for string length
Membro registado
5 mensagems
Publicado em agosto, 09 2024 - 2:51 AM
a1 is string = "123"
a2 is string = "0000000000"
right( a2+a1, 10 )

"0000000123"

--
Alex Solares