KB-32719: Extracting characters from the left or from the right with VBScript.

Question:

How can I extract a certain amount of characters from a script’s left or right?

Solution:

To do so, use Left and Right functions to extract characters from the string’s left and right, respectively. Just pass the string and the number of characters to be extracted.

Example:

Dim Word, Left, Right

Word = “Elipse E3”
Left = Left(Word, 6)    ‘ Returns “Elipse”.
Right = Right(Word, 2)  ‘ Returns “E3”.

MsgBox Left
MsgBox Right

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 *