Trim$
TrimmedString$ = Trim$(SourceString$, [Remove$ =Space&TAbs])
 
Parameters:

    SourceString$ = The string you wish to trme/remove common head/tail characters from
    [Remove$ =Space&TAbs] = The optional characters string to remove. The default characters are spaces and tabs
Returns:

    TrimmedString$ = The returned string with the Head/Tail characters removed
 

      The Trim$ function will remove any unwanted characters from the head and tail of the source string. The characters to be removed are specified by the user with the Remove$ parameter.



FACTS:


      * None.




Mini Tutorial:



  
  
; Define a string variable called message
  Message$="-------Hello World-------------"
  
  
; Display this string variable
  Print Message$
  
; Display the trimmed message
  Print Trim$(Message$,"-")
  
; Display the left trimmed message
  Print TrimLeft$(Message$,"-")
  
; Display the right trimmed message
  Print TrimRight$(Message$,"-")
  
; display the screen and wait for a key press
  Sync
  WaitKey
  
  



This example would output.

  
  -------Hello World-------------
  Hello World
  Hello World-------------
  -------Hello World
  


 
Related Info: CutLeft$ | CutRight$ | Left$ | Mid$ | Right$ | TrimLeft$ | TrimRight$ :
 


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