Visara Master Console Center Scripting Guide Manuel d'utilisateur Page 143

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 262
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 142
Chapter 5 Script Commands
Scripting Guide 143
LEFTSTR
Syntax:
LEFTSTR( $String, %Count) ==> $SubStr
Description:
Returns the leftmost specified number of characters of a string expression.
Action:
A substring is extracted from a string expression. The substring begins
with the first character in the string expression.
Parameters:
$String. String expression. The character string from which to extract
characters.
%Count. Numeric expression. The number of characters to extract. If
Count is negative or zero, LEFTSTR() returns an empty string “”. If Count
is larger than the length of String, LEFTSTR() returns the entire String.
Returns:
String value. The leftmost Count characters of String as a character string.
Notes:
Example:
$Msg := “This is a test.”
$Var := LEFTSTR( $Msg, 4)
// $Var will contain the string ‘This’
$Var := LEFTSTR( “****” + $Msg[ 1] + $Msg[ 2] + “****”, 20)
// $Var will contain a string starting with 4 asterisks, and
// containing the first 16 characters of the combination of
// strings $Msg[1] and $Msg[2]. If there are less than 16
// characters in those variables, $Var will also contain up to
// 4 asterisks at the end.
See Also:
ATSTR, FINDSTR, RIGHTSTR, REPSTR, STR, SUBSTR
Vue de la page 142
1 2 ... 138 139 140 141 142 143 144 145 146 147 148 ... 261 262

Commentaires sur ces manuels

Pas de commentaire