Visara Master Console Center Scripting Guide Manuale Utente Pagina 143

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 262
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 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
Vedere la pagina 142
1 2 ... 138 139 140 141 142 143 144 145 146 147 148 ... 261 262

Commenti su questo manuale

Nessun commento