Right$
ReturnString$ = Right$(SourceString$, NumberOfCharacters)
 
Parameters:

    SourceString$ = The String You Wish to Grab the Left Characters of
    NumberOfCharacters = The Number of Characters to Grab, Starting from the Left side of the string
Returns:

    ReturnString$
 

     RIGHT$ grabs the right most part (the TAIL) of the source string$. The characters are copied left to right. The starting point is calculated by taking the length of the source string and subtracting the number of characters you wish to copy.



FACTS:


      * Characters are copied from left to right.

      * Right$ calculates where to start copying characters via StringLength-NumberOFCharacters



Mini Tutorial:


  
  Number$="1234567890"
  Print Right$(Numbers$,3)
  
  Sync
  WaitKey
  


In this example, the RIGHT$ function will copy the last three characters from the string number$, starting at character eight (length of string (10 characters in this example)- minus characters to copy (3) ) and grabbing all the characters following this (from the left hand side). So it will output the characters 890 to the display.



 
Example Source: Download This Example
; ---------------------------------------
; Right$ EXAMPLE
; ---------------------------------------
  
; Create a String Variable called "SourceString$" and place the text "Play Basic" within it.
  SourceString$= "Play Basic"
  
; Grab the Last Five characters from SourceString$ using Right$() then place those
; Characters into the variable Grab$
  
  Grab$=Right$(SourceString$,5)
  
; Display the SourceString$ variable
  Print SourceString$
  
; Display the Grab$ variable..
  Print Grab$
  
; Show Us the Screen And Wait for Key Input before ending
  Sync
  WaitKey
  
  
 
Related Info: CutLeft$ | CutRight$ | Left$ | Mid$ | SplitToArray | trim$ | Trimleft$ | TrimRight$ :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com