<< Prev        Next >>

RTrim

Function

To delete a tailing space in a string.

Syntax

RTrim(string)

Guaranteed entry

String
Designate string type data.

Return value

Return string type data with the tailing space of the string deleted.

Description

A designated string is returned with any tailing space, etc. deleted.

Character to delete Character code
Space (single byte) Chr(32)
Space (double byte)
Tab Chr(9)
Line feed character Chr(10)
Carriage return Chr(13)

Related Terms

-

Attention

-

Example

'!TITLE "Deleting Tailing Space of String"
' Display a string whose space is deleted from the tailing of the string on the message output window
Sub Sample_RTrim

  Dim aaa As String
  Dim bbb As String
  Dim ccc As String
  Dim ddd as String

  ' Assign a string " Denso Corporation" to which a one byte space is input at its tailing to aaa
  aaa = "Denso Corporation "

  ' Display "Denso Corporation" on the message output window
  PrintDbg aaa 

  ' Assign a string "Denso Corporation  " to which a tab is input at its tailing to bbb
  bbb = "Denso Corporation  "

  ' Display "Denso Corporation" on the message output window
  PrintDbg bbb 

  ' Assign a string of aaa from which space is deleted from its tailing to ccc
  ccc = Trim( aaa )

  ' Assign a string of bbb from which space is deleted from its tailing to ddd
  ddd = Trim( bbb )

  ' Display "Denso Corporation" on the message output window
  PrintDbg ccc

  ' Display "Denso Corporation" on the message output window
  PrintDbg ddd

End Sub

<< Prev        Next >>