KB-28076: Removing blank spaces from a variable.

Question:

How can I remove blank spaces from a variable? For example, the text “Elipse Software Ltd.” is in a variable, but I want to display “ElipseSoftwareLtd.” instead.

Solution:

To do so, you can write the following script:


Dim aux, tmp, auxValue

tmp = Len(WithBlankSpaces)

WithoutBlankSpaces = “”

for aux = 0 to tmp – 1
auxValue = Mid(WithBlankSpaces,aux,1)
If auxValue <> ” “
WithoutBlankSpaces = WithoutBlankSpaces + auxValue
Endif
Next

In this script, WithBlankSpaces is a RAM Tag that receives the original text (in this case, “Elipse Software Ltd.”), and WithoutBlankSpaces is the RAM Tag that receives the script’s result (in this case, “ElipseSoftwareLtd.”).

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Leave a Reply

Your email address will not be published.Required fields are marked *