KB-15373: Function that returns characters from a string.

Question:

How can I split a string into smaller parts?

Solution:

To do so, you can use the Global Manager’s Right, Left and Mid functions, found at Elipse SCADA’s Global Manager.

Right (string, nCount)
Returns the nCount characters to the right of the string’s parameter.
Example of script: str = Right(“Password”,4) // returns “word”

Left (string, nCount)
Returns the nCount characters to the right of the string’s parameter.
Example of script: String = Left(‘Password’, 4) // returns’Pass’

Mid (strText, nFirst, [nCount])
Returns part of strText according to nFirst and nCount parameters. nFirst especifies the position, in the string, of the first character of the substring that is returns (count starts at zero). nCount is the number of characters of the substring.

Examples of script: strSenha = Mid(‘Password’, 0, 3) // returns’Pas’
              strSenha = Mid(‘Password’, 3, 4) // returns’swor’
              strSenha = Mid(‘Password’, 2) // returns’ssword’

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

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

,

Deixe seu Comentário

Seu endereço de e-mail não será publicado. Campos marcados com asterisco são obrigatórios *